Skip to content

Commit

Permalink
test case update
Browse files Browse the repository at this point in the history
  • Loading branch information
AvinashKapre committed Sep 20, 2024
1 parent 3d71d5f commit 1eadcd8
Showing 1 changed file with 74 additions and 68 deletions.
142 changes: 74 additions & 68 deletions modules/pubmatic/openwrap/entrypointhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}),
},
},
},
Expand Down Expand Up @@ -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{}),
},
},
},
Expand Down Expand Up @@ -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{}),
},
},
},
Expand Down Expand Up @@ -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{}),
},
},
},
Expand Down Expand Up @@ -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{}),
},
},
},
Expand Down Expand Up @@ -593,7 +598,8 @@ func TestOpenWrap_handleEntrypointHook(t *testing.T) {
},
},
},
SendBurl: true,
SendBurl: true,
ImpCountingMethodEnabledBidders: make(map[string]struct{}),
},
},
},
Expand Down

0 comments on commit 1eadcd8

Please sign in to comment.