Skip to content

Commit

Permalink
review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
AvinashKapre committed Dec 9, 2024
1 parent 7ff7608 commit 191ed4d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/pubmatic/openwrap/defaultbids.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func (m *OpenWrap) addDefaultBidsForMultiFloorsConfig(rctx *models.RequestCtx, b

for impID, impCtx := range rctx.ImpBidCtx {
adunitFloors, ok := rctx.AppLovinMax.MultiFloorsConfig.Config[impCtx.TagID]
if !ok {
if !ok || len(adunitFloors) == 0 {
continue
}
for bidder := range impCtx.Bidders {
Expand Down
58 changes: 58 additions & 0 deletions modules/pubmatic/openwrap/defaultbids_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,64 @@ func TestOpenWrap_addDefaultBidsForMultiFloorsConfig(t *testing.T) {
},
},
},
{
name: "mulit-floors config have adunit configured but no floor in config and no bids in the response",
args: args{
rctx: &models.RequestCtx{
Endpoint: models.EndpointAppLovinMax,
DefaultBids: map[string]map[string][]openrtb2.Bid{
"test-impID-1": {
"pubmatic": {
{
ID: "dbbsdhkldks1234",
ImpID: "test-impID-1",
Ext: []byte(`{}`),
},
},
},
},
AppLovinMax: models.AppLovinMax{
MultiFloorsConfig: models.MultiFloorsConfig{
Enabled: true,
Config: models.ApplovinAdUnitFloors{
"adunit-1": []float64{},
},
},
},
ImpBidCtx: map[string]models.ImpCtx{
"test-impID-1": {
TagID: "adunit-1",
Bidders: map[string]models.PartnerData{
"pubmatic": {
PrebidBidderCode: "pubmatic",
},
},
BidCtx: map[string]models.BidCtx{},
},
},
PrebidBidderCode: map[string]string{
"pubmatic": "pubmatic",
},
},
bidResponse: &openrtb2.BidResponse{
ID: "bid-1",
},
},
fields: fields{
uuidGenerator: TestUUIDGenerator{},
},
want: map[string]map[string][]openrtb2.Bid{
"test-impID-1": {
"pubmatic": {
{
ID: "dbbsdhkldks1234",
ImpID: "test-impID-1",
Ext: []byte(`{}`),
},
},
},
},
},
{
name: "mulit-floors config have three floors and only one bid in the response",
args: args{
Expand Down

0 comments on commit 191ed4d

Please sign in to comment.