From 1eadcd82934b9b2f2ee137c770614562ed1daf03 Mon Sep 17 00:00:00 2001 From: Avinash Kapre Date: Fri, 20 Sep 2024 09:59:32 +0530 Subject: [PATCH] test case update --- .../pubmatic/openwrap/entrypointhook_test.go | 142 +++++++++--------- 1 file changed, 74 insertions(+), 68 deletions(-) diff --git a/modules/pubmatic/openwrap/entrypointhook_test.go b/modules/pubmatic/openwrap/entrypointhook_test.go index 57b35a17ce1..e2b209a8133 100644 --- a/modules/pubmatic/openwrap/entrypointhook_test.go +++ b/modules/pubmatic/openwrap/entrypointhook_test.go @@ -126,17 +126,18 @@ func TestOpenWrap_handleEntrypointHook(t *testing.T) { Name: "KADUSERCOOKIE", Value: `7D75D25F-FAC9-443D-B2D1-B17FEE11E027`, }, - OriginCookie: "go-test", - Aliases: make(map[string]string), - ImpBidCtx: make(map[string]models.ImpCtx), - PrebidBidderCode: make(map[string]string), - BidderResponseTimeMillis: make(map[string]int), - ProfileIDStr: "5890", - Endpoint: models.EndpointV25, - MetricsEngine: mockEngine, - SeatNonBids: make(map[string][]openrtb_ext.NonBid), - Method: "POST", - WakandaDebug: &wakanda.Debug{}, + OriginCookie: "go-test", + Aliases: make(map[string]string), + ImpBidCtx: make(map[string]models.ImpCtx), + PrebidBidderCode: make(map[string]string), + BidderResponseTimeMillis: make(map[string]int), + ProfileIDStr: "5890", + Endpoint: models.EndpointV25, + MetricsEngine: mockEngine, + SeatNonBids: make(map[string][]openrtb_ext.NonBid), + Method: "POST", + WakandaDebug: &wakanda.Debug{}, + ImpCountingMethodEnabledBidders: make(map[string]struct{}), }, }, }, @@ -173,29 +174,30 @@ func TestOpenWrap_handleEntrypointHook(t *testing.T) { want: hookstage.HookResult[hookstage.EntrypointPayload]{ ModuleContext: hookstage.ModuleContext{ "rctx": models.RequestCtx{ - PubIDStr: "5890", - PubID: 5890, - ProfileID: 5890, - DisplayID: 1, - DisplayVersionID: 1, - SSAuction: -1, - Debug: true, - UA: "go-test", - IP: "127.0.0.1", - IsCTVRequest: false, - TrackerEndpoint: "t.pubmatic.com", - VideoErrorTrackerEndpoint: "t.pubmatic.com/error", - LoggerImpressionID: "4df09505-d0b2-4d70-94d9-dc41e8e777f7", - Aliases: make(map[string]string), - ImpBidCtx: make(map[string]models.ImpCtx), - PrebidBidderCode: make(map[string]string), - BidderResponseTimeMillis: make(map[string]int), - ProfileIDStr: "5890", - Endpoint: models.EndpointV25, - MetricsEngine: mockEngine, - SeatNonBids: make(map[string][]openrtb_ext.NonBid), - Method: "POST", - WakandaDebug: &wakanda.Debug{}, + PubIDStr: "5890", + PubID: 5890, + ProfileID: 5890, + DisplayID: 1, + DisplayVersionID: 1, + SSAuction: -1, + Debug: true, + UA: "go-test", + IP: "127.0.0.1", + IsCTVRequest: false, + TrackerEndpoint: "t.pubmatic.com", + VideoErrorTrackerEndpoint: "t.pubmatic.com/error", + LoggerImpressionID: "4df09505-d0b2-4d70-94d9-dc41e8e777f7", + Aliases: make(map[string]string), + ImpBidCtx: make(map[string]models.ImpCtx), + PrebidBidderCode: make(map[string]string), + BidderResponseTimeMillis: make(map[string]int), + ProfileIDStr: "5890", + Endpoint: models.EndpointV25, + MetricsEngine: mockEngine, + SeatNonBids: make(map[string][]openrtb_ext.NonBid), + Method: "POST", + WakandaDebug: &wakanda.Debug{}, + ImpCountingMethodEnabledBidders: make(map[string]struct{}), }, }, }, @@ -276,17 +278,18 @@ func TestOpenWrap_handleEntrypointHook(t *testing.T) { Name: "KADUSERCOOKIE", Value: `7D75D25F-FAC9-443D-B2D1-B17FEE11E027`, }, - OriginCookie: "go-test", - Aliases: make(map[string]string), - ImpBidCtx: make(map[string]models.ImpCtx), - PrebidBidderCode: make(map[string]string), - BidderResponseTimeMillis: make(map[string]int), - ProfileIDStr: "43563", - Endpoint: models.EndpointWebS2S, - MetricsEngine: mockEngine, - SeatNonBids: make(map[string][]openrtb_ext.NonBid), - Method: "POST", - WakandaDebug: &wakanda.Debug{}, + OriginCookie: "go-test", + Aliases: make(map[string]string), + ImpBidCtx: make(map[string]models.ImpCtx), + PrebidBidderCode: make(map[string]string), + BidderResponseTimeMillis: make(map[string]int), + ProfileIDStr: "43563", + Endpoint: models.EndpointWebS2S, + MetricsEngine: mockEngine, + SeatNonBids: make(map[string][]openrtb_ext.NonBid), + Method: "POST", + WakandaDebug: &wakanda.Debug{}, + ImpCountingMethodEnabledBidders: make(map[string]struct{}), }, }, }, @@ -337,17 +340,18 @@ func TestOpenWrap_handleEntrypointHook(t *testing.T) { Name: "KADUSERCOOKIE", Value: `7D75D25F-FAC9-443D-B2D1-B17FEE11E027`, }, - OriginCookie: "go-test", - Aliases: make(map[string]string), - ImpBidCtx: make(map[string]models.ImpCtx), - PrebidBidderCode: make(map[string]string), - BidderResponseTimeMillis: make(map[string]int), - ProfileIDStr: "43563", - Endpoint: models.EndpointWebS2S, - MetricsEngine: mockEngine, - SeatNonBids: make(map[string][]openrtb_ext.NonBid), - Method: "POST", - WakandaDebug: &wakanda.Debug{}, + OriginCookie: "go-test", + Aliases: make(map[string]string), + ImpBidCtx: make(map[string]models.ImpCtx), + PrebidBidderCode: make(map[string]string), + BidderResponseTimeMillis: make(map[string]int), + ProfileIDStr: "43563", + Endpoint: models.EndpointWebS2S, + MetricsEngine: mockEngine, + SeatNonBids: make(map[string][]openrtb_ext.NonBid), + Method: "POST", + WakandaDebug: &wakanda.Debug{}, + ImpCountingMethodEnabledBidders: make(map[string]struct{}), }, }, }, @@ -500,17 +504,18 @@ func TestOpenWrap_handleEntrypointHook(t *testing.T) { Name: "KADUSERCOOKIE", Value: `7D75D25F-FAC9-443D-B2D1-B17FEE11E027`, }, - OriginCookie: "go-test", - Aliases: make(map[string]string), - ImpBidCtx: make(map[string]models.ImpCtx), - PrebidBidderCode: make(map[string]string), - BidderResponseTimeMillis: make(map[string]int), - ProfileIDStr: "5890", - Endpoint: models.EndpointV25, - MetricsEngine: mockEngine, - SeatNonBids: make(map[string][]openrtb_ext.NonBid), - Method: "POST", - WakandaDebug: &wakanda.Debug{}, + OriginCookie: "go-test", + Aliases: make(map[string]string), + ImpBidCtx: make(map[string]models.ImpCtx), + PrebidBidderCode: make(map[string]string), + BidderResponseTimeMillis: make(map[string]int), + ProfileIDStr: "5890", + Endpoint: models.EndpointV25, + MetricsEngine: mockEngine, + SeatNonBids: make(map[string][]openrtb_ext.NonBid), + Method: "POST", + WakandaDebug: &wakanda.Debug{}, + ImpCountingMethodEnabledBidders: make(map[string]struct{}), }, }, }, @@ -593,7 +598,8 @@ func TestOpenWrap_handleEntrypointHook(t *testing.T) { }, }, }, - SendBurl: true, + SendBurl: true, + ImpCountingMethodEnabledBidders: make(map[string]struct{}), }, }, },