-
Notifications
You must be signed in to change notification settings - Fork 738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Panic in bid adjustments #3547
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -220,34 +220,26 @@ func TestMerge(t *testing.T) { | |
testCases := []struct { | ||
name string | ||
givenRequestWrapper *openrtb_ext.RequestWrapper | ||
givenAccount *config.Account | ||
acctBidAdjustments *openrtb_ext.ExtRequestPrebidBidAdjustments | ||
expectedBidAdjustments *openrtb_ext.ExtRequestPrebidBidAdjustments | ||
}{ | ||
{ | ||
name: "DiffBidderNames", | ||
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"prebid":{"bidadjustments":{"mediatype":{"banner":{"bidderA":{"dealId":[{ "adjtype": "multiplier", "value": 1.1}]}}}}}}`)}, | ||
}, | ||
givenAccount: &config.Account{ | ||
BidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}, | ||
}, | ||
}, | ||
acctBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}}, | ||
}, | ||
}, | ||
}, | ||
expectedBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}, | ||
}, | ||
"bidderB": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}, | ||
}, | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}}, | ||
"bidderB": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -257,23 +249,17 @@ func TestMerge(t *testing.T) { | |
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"prebid":{"bidadjustments":{"mediatype":{"audio":{"bidderA":{"dealId":[{ "adjtype": "multiplier", "value": 1.1}]}}}}}}`)}, | ||
}, | ||
givenAccount: &config.Account{ | ||
BidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Audio: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}, | ||
}, | ||
}, | ||
acctBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Audio: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}}, | ||
}, | ||
}, | ||
}, | ||
expectedBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Audio: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}, | ||
}, | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -283,14 +269,10 @@ func TestMerge(t *testing.T) { | |
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"prebid":{"bidadjustments":{"mediatype":{"video-instream":{"bidderA":{"dealId":[{ "adjtype": "static", "value": 3.00, "currency": "USD"}]}}}}}}`)}, | ||
}, | ||
givenAccount: &config.Account{ | ||
BidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
VideoInstream: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": { | ||
"diffDealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}, | ||
}, | ||
}, | ||
acctBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
VideoInstream: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": {"diffDealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -310,26 +292,18 @@ func TestMerge(t *testing.T) { | |
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"prebid":{"bidadjustments":{"mediatype":{"native":{"bidderA":{"dealId":[{"adjtype": "cpm", "value": 0.18, "currency": "USD"}]}}}}}}`)}, | ||
}, | ||
givenAccount: &config.Account{ | ||
BidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Native: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}, | ||
}, | ||
}, | ||
acctBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Native: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}}, | ||
}, | ||
}, | ||
}, | ||
expectedBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Native: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeCPM, Value: 0.18, Currency: "USD"}}, | ||
}, | ||
"bidderB": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}, | ||
}, | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeCPM, Value: 0.18, Currency: "USD"}}}, | ||
"bidderB": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -339,28 +313,20 @@ func TestMerge(t *testing.T) { | |
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"prebid":{"bidadjustments":{"mediatype":{"video-outstream":{"bidderA":{"dealId":[{ "adjtype": "multiplier", "value": 1.1}]}}}}}}`)}, | ||
}, | ||
givenAccount: &config.Account{ | ||
BidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}, | ||
}, | ||
}, | ||
acctBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}}, | ||
}, | ||
}, | ||
}, | ||
expectedBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}, | ||
}, | ||
"bidderB": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}}, | ||
}, | ||
VideoOutstream: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}, | ||
}, | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -370,23 +336,17 @@ func TestMerge(t *testing.T) { | |
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"ext":{"bidder": {}}}`)}, | ||
}, | ||
givenAccount: &config.Account{ | ||
BidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}, | ||
}, | ||
}, | ||
acctBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}}, | ||
}, | ||
}, | ||
}, | ||
expectedBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}, | ||
}, | ||
"bidderB": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -396,28 +356,20 @@ func TestMerge(t *testing.T) { | |
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"prebid":{"bidadjustments":{"mediatype":{"video-instream":{"bidderA":{"dealId":[{ "adjtype": "multiplier", "value": 1.1}]}}}}}}`)}, | ||
}, | ||
givenAccount: &config.Account{ | ||
BidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
WildCard: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}, | ||
}, | ||
}, | ||
acctBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
WildCard: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}}, | ||
}, | ||
}, | ||
}, | ||
expectedBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
WildCard: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}, | ||
}, | ||
"bidderB": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.5}}}, | ||
}, | ||
VideoInstream: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}, | ||
}, | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -427,21 +379,137 @@ func TestMerge(t *testing.T) { | |
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"ext":{"bidder": {}}}`)}, | ||
}, | ||
givenAccount: &config.Account{}, | ||
acctBidAdjustments: nil, | ||
expectedBidAdjustments: nil, | ||
}, | ||
{ | ||
name: "NilAcctBidAdj", | ||
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"prebid":{"bidadjustments":{"mediatype":{"banner":{"bidderA":{"dealId":[{ "adjtype": "multiplier", "value": 1.1}]}}}}}}`)}, | ||
}, | ||
givenAccount: &config.Account{}, | ||
acctBidAdjustments: nil, | ||
expectedBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": { | ||
"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}, | ||
}, | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
{ | ||
name: "NilExtPrebid-NilExtPrebidBidAdj_NilAcct", | ||
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{}, | ||
}, | ||
acctBidAdjustments: nil, | ||
expectedBidAdjustments: nil, | ||
}, | ||
{ | ||
name: "NilExtPrebid-NilExtPrebidBidAdj-Acct", | ||
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{}, | ||
}, | ||
acctBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}}, | ||
}, | ||
}, | ||
}, | ||
expectedBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: "NotNilExtPrebid-NilExtBidAdj-NilAcct", | ||
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"prebid":{}}`)}, | ||
}, | ||
acctBidAdjustments: nil, | ||
expectedBidAdjustments: nil, | ||
}, | ||
{ | ||
name: "NotNilExtPrebid_NilExtBidAdj_NotNilAcct", | ||
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"prebid":{}}`)}, | ||
}, | ||
acctBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}}, | ||
}, | ||
}, | ||
}, | ||
expectedBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: "NotNilExtPrebid-NotNilExtBidAdj-NilAcct", | ||
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"prebid":{"bidadjustments":{"mediatype":{"banner":{"bidderA":{"dealId":[{ "adjtype": "multiplier", "value": 1.1}]}}}}}}`)}, | ||
}, | ||
acctBidAdjustments: nil, | ||
expectedBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: "NotNilExtPrebid-NotNilExtBidAdj-NotNilAcct", | ||
givenRequestWrapper: &openrtb_ext.RequestWrapper{ | ||
BidRequest: &openrtb2.BidRequest{Ext: []byte(`{"prebid":{"bidadjustments":{"mediatype":{"banner":{"bidderA":{"dealId":[{ "adjtype": "multiplier", "value": 1.1}]}}}}}}`)}, | ||
}, | ||
acctBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
VideoInstream: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeCPM, Value: 3}}}, | ||
}, | ||
VideoOutstream: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: Just to make the test case less verbose, can we remove some of the elements so we are only left with bidder There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's necessary to test all media types |
||
"bidderC": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeCPM, Value: 3}}}, | ||
}, | ||
Audio: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderD": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeCPM, Value: 3}}}, | ||
}, | ||
Native: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderE": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeCPM, Value: 3}}}, | ||
}, | ||
WildCard: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderF": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeCPM, Value: 3}}}, | ||
}, | ||
}, | ||
}, | ||
expectedBidAdjustments: &openrtb_ext.ExtRequestPrebidBidAdjustments{ | ||
MediaType: openrtb_ext.MediaType{ | ||
Banner: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderA": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeMultiplier, Value: 1.1}}}, | ||
}, | ||
VideoInstream: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderB": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeCPM, Value: 3}}}, | ||
}, | ||
VideoOutstream: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderC": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeCPM, Value: 3}}}, | ||
}, | ||
Audio: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderD": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeCPM, Value: 3}}}, | ||
}, | ||
Native: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderE": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeCPM, Value: 3}}}, | ||
}, | ||
WildCard: map[openrtb_ext.BidderName]openrtb_ext.AdjustmentsByDealID{ | ||
"bidderF": {"dealId": []openrtb_ext.Adjustment{{Type: AdjustmentTypeCPM, Value: 3}}}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -450,7 +518,7 @@ func TestMerge(t *testing.T) { | |
|
||
for _, test := range testCases { | ||
t.Run(test.name, func(t *testing.T) { | ||
mergedBidAdj, err := merge(test.givenRequestWrapper, test.givenAccount.BidAdjustments) | ||
mergedBidAdj, err := merge(test.givenRequestWrapper, test.acctBidAdjustments) | ||
assert.NoError(t, err) | ||
assert.Equal(t, test.expectedBidAdjustments, mergedBidAdj) | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: can we remove the extra space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed extra line breaks, the next removal will lead to poor readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry for the confusion. By extra space I meant line 435 only. I was ok with the rest of the line breaks. I agree that removing them leads to poor readability. I'll approve anyways.