-
Notifications
You must be signed in to change notification settings - Fork 753
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
Adhese: Switch to openrtb2 endpoint #3864
Open
mefjush
wants to merge
16
commits into
prebid:master
Choose a base branch
from
adhese:new_endpoint
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+725
−1,411
Open
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b0fa7b3
Feat/adhese adapter v2 (#11)
mefjush 0993436
Update the test requests to better match the prod
mefjush 81eeec0
change scope of types to be local
skonky b526fc5
make use of response util
skonky 7d29bdb
check if currency on the response is defined
skonky 5d7d4d5
fix test
skonky 8f5225f
explicitly set the type
skonky cec6ba8
Merge remote-tracking branch 'upstream/master' into new_endpoint
skonky 90d0c3d
fix test suite
skonky ce3e470
fix: remove error for empty imp in adhese adapter
skonky 53b2e98
table driven test design
skonky e77f3e2
added minlenght for required fields
skonky bc41b27
use fake url instead of real
skonky 2442c2e
remove redundant check
skonky e1c5641
remove redundant checks
skonky 46122f8
removed unused code
skonky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 0 additions & 107 deletions
107
adapters/adhese/adhesetest/exemplary/banner-internal.json
This file was deleted.
Oops, something went wrong.
175 changes: 111 additions & 64 deletions
175
adapters/adhese/adhesetest/exemplary/banner-market.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,148 @@ | ||
{ | ||
"mockBidRequest": { | ||
"id": "test-req", | ||
"user": { | ||
"ext": { | ||
"consent": "dummy" | ||
} | ||
}, | ||
"imp": [ | ||
{ | ||
"id": "test-req", | ||
"banner": { | ||
"format": [ | ||
{ | ||
"w": 300, | ||
"h": 250 | ||
} | ||
] | ||
"w": 300, | ||
"h": 250 | ||
}, | ||
"ext": { | ||
"bidder": { | ||
"location": "pbs_test", | ||
"format": "pbs_mr", | ||
"account": "market", | ||
"location": "_adhese_prebid_demo_", | ||
"format": "leaderboard", | ||
"targets": | ||
{ | ||
"ci": ["gent", "brussels"], | ||
"ag": ["55"], | ||
"tl": ["all"] | ||
"targets": { | ||
"ci": [ | ||
"gent", | ||
"brussels" | ||
], | ||
"ag": [ | ||
"55" | ||
], | ||
"tl": [ | ||
"all" | ||
] | ||
} | ||
} | ||
}, | ||
"tid": "6811e2a1-3649-4e54-ba03-c9b1401ae728" | ||
} | ||
} | ||
], | ||
"site": { | ||
"id": "test", | ||
"publisher": { | ||
"id": "123" | ||
}, | ||
"page": "dummy" | ||
} | ||
} | ||
}, | ||
"httpCalls": [ | ||
{ | ||
"expectedRequest": { | ||
"uri": "https://ads-market.adhese.com/json/sl_adhese_prebid_demo_-leaderboard/ag55/cigent;brussels/tlall/xfdummy", | ||
"impIDs":["test-req"] | ||
"uri": "https://ads-market.adhese.com/openrtb2", | ||
"impIDs": [ | ||
"test-req" | ||
], | ||
"body": { | ||
"id": "test-req", | ||
"imp": [ | ||
{ | ||
"banner": { | ||
"h": 250, | ||
"w": 300 | ||
}, | ||
"ext": { | ||
"adhese": { | ||
"SL": [ | ||
"pbs_test-pbs_mr" | ||
], | ||
"ag": [ | ||
"55" | ||
], | ||
"ci": [ | ||
"gent", | ||
"brussels" | ||
], | ||
"tl": [ | ||
"all" | ||
] | ||
} | ||
}, | ||
"id": "test-req" | ||
} | ||
], | ||
"site": { | ||
"id": "test", | ||
"publisher": { | ||
"id": "123" | ||
} | ||
}, | ||
"user": { | ||
"ext": { | ||
"consent": "dummy" | ||
} | ||
} | ||
} | ||
}, | ||
"mockResponse": { | ||
"status": 200, | ||
"body": [{ | ||
"origin": "APPNEXUS", | ||
"originInstance": "", | ||
"ext": "js", | ||
"slotName": "_main_page_-leaderboard", | ||
"adType": "leaderboard", | ||
"originData": { | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"crid": "60613369", | ||
"dealid": null | ||
} | ||
], | ||
"seat": "958" | ||
} | ||
] | ||
}, | ||
"width": "728", | ||
"height": "90", | ||
"body": "<div style='background-color:red; height:250px; width:300px'></div>", | ||
"tracker": "https://hosts-demo.adhese.com/rtb_gateway/handlers/client/track/?id=a2f39296-6dd0-4b3c-be85-7baa22e7ff4a", | ||
"impressionCounter": "https://hosts-demo.adhese.com/rtb_gateway/handlers/client/track/?id=a2f39296-6dd0-4b3c-be85-7baa22e7ff4a", | ||
"extension": { | ||
"prebid": { | ||
"cpm": { | ||
"amount": "1", | ||
"currency": "USD" | ||
} | ||
"body": { | ||
"id": "test-req", | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"price": 1.087, | ||
"adm": "<html><body style=\\\"margin:0%\\\"><a href=\\\"http://dev.tokyo.iponweb.net/click/KqFxs5SWsPYVXsL3wNKozGVQHK0aIuJ7t4amL-rK1dP0KFlKd3Z.K-Ch.NZ5GYKUyKRDAU794n-hSF9-LWCpovlxqPY49KxpP97JlRh2ux4f.kndmby6vvs0hXLFu4r0WBlhUT9qANUJZJ2bsvPV3kF4a6k60.wwL36qDxplquNmhT5mxsORhcUjFbDP1Sc0KNOfqf6kys.YEQ3VB8XvPK.1m.kZ2lCH6zP30PnHTdQO.6zyDRjFASwdDW-ayaRAiTWMeqpRzQlBMyG3MzWg6VgOclmvkn6BdlvNooBrQg2aIfYeNs8WMQ8LGKgjtH6ADbmE00uWsKQJaAMCrxFROhUVLvYGa.T.KDiHMDR6.FPQ5TCG.GrUS95X4c1S1w0ln7W9UKVh-Q3T7Qr6kj9VbyvtkLVhMhVT5Gnk4dw01Xneb4eih8hK8qU5urejYRdeVW3iFTx.MModFQw2WfarrFoeyB.Sjc5lbYcFDce5QlLoDXV14faAz6WSylogVnkHdCP9oTOuGMDeC752tCZt36HWbXucBBseAmi5njcmdfpF//http%3A%2F%2Fwww.chris.com\\\" target=\\\"_blank\\\"><img style=\\\"border: 0;\\\" border=\\\"0\\\" width=\\\"300\\\" height=\\\"250\\\" src=\\\"http://test.360yield.com/file/226569/LeftAligned_blue.png\\\" alt=\\\"\\\"/></a><img src=\\\"http://dev.tokyo.iponweb.net/imp_pixel?ic=KqFxs3bhZwS9j9reQlSW5affOay54sEDsEqQzNMeQr0olHvVZJJVG8HOZ.mPgdCcksXTG1UvtBnYVxu2F0jlB76NSwEQaxULkEsUfXMPbKKkP8v0tLFkLeF1iDgO9bjAJmxyVYtIA4C-hGy80tDfcltIKfy1JNz-zf7E0XNHKo1T8yGugThU2Uo65uR1v8jsYEFh3VmpI2pUvQgKAspX.WLBmON8jCfPuHCZr2dpyVhJ50PBavKBsON0gcwc5iwNhiF-.RFbqkmAZOXtt1DluDjddZelUghV8FnKLV1OAaJvHeMaeSwMYEYs355-53R3szvp2s9yvFDTI9P5X9Z.a0uMtuXoHyqjUFn79MCnntwYtqPxu9Ho17jgB2w4HCI2qd3bhEJG04lC-pDMOUkrD19.-ivMBkdYVKgl-5b13gS2e9absDIuy.1YWsdex3PTGXDMr68kpHI9lisCMd7EEWLQep-J37l1HyVZqT63cPvpim3siP6smbiAiR8lzu6JUKHgglc0oYWAVBCL4cwA4qKKqvpRrL8xQ4vRG8V9DPI8\\\" alt=\\\" \\\" style=\\\"display:none\\\"/><improvedigital_ad_output_information tp_id=\\\"\\\" buyer_id=\\\"0\\\" rtb_advertiser=\\\"\\\" campaign_id=\\\"284945\\\" line_item_id=\\\"367603\\\" creative_id=\\\"456851\\\" crid=\\\"0\\\" placement_id=\\\"1071749\\\"></improvedigital_ad_output_information></body></html><div style=\\\"position: absolute; left: 0px; top: 0px; visibility: hidden;\\\"><img src=\\\"http://127.0.0.1:8080/rtb_gateway/handlers/client/track/?id=0a9348ab-973d-4596-9ee8-bafa4e5d0865\\\" border=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\" alt=\\\"\\\" style=\\\"display:none\\\"></div>", | ||
"w": 300, | ||
"h": 250, | ||
"crid": "demo-475", | ||
"dealid": "demo-234", | ||
"ext": { | ||
"adhese": { | ||
"adType": "leaderboard", | ||
"adFormat": "superadformat" | ||
} | ||
}, | ||
"id": "a5ec99e8-aa6b-42f4-bf8b-b68dabf96caf", | ||
"impid": "imp_id" | ||
} | ||
] | ||
} | ||
} | ||
}] | ||
], | ||
"cur": "USD" | ||
} | ||
} | ||
} | ||
], | ||
"expectedBidResponses": [ | ||
{ | ||
"currency": "USD", | ||
"bids": [ | ||
{ | ||
"bid": { | ||
"adm": "<div style='background-color:red; height:250px; width:300px'></div>", | ||
"w": 728, | ||
"h": 90, | ||
"id": "", | ||
"impid": "", | ||
"crid": "60613369", | ||
"price": 1.000000 | ||
}, | ||
"type": "banner" | ||
} | ||
] | ||
"bids": [ | ||
{ | ||
"bid": { | ||
"adm": "<html><body style=\\\"margin:0%\\\"><a href=\\\"http://dev.tokyo.iponweb.net/click/KqFxs5SWsPYVXsL3wNKozGVQHK0aIuJ7t4amL-rK1dP0KFlKd3Z.K-Ch.NZ5GYKUyKRDAU794n-hSF9-LWCpovlxqPY49KxpP97JlRh2ux4f.kndmby6vvs0hXLFu4r0WBlhUT9qANUJZJ2bsvPV3kF4a6k60.wwL36qDxplquNmhT5mxsORhcUjFbDP1Sc0KNOfqf6kys.YEQ3VB8XvPK.1m.kZ2lCH6zP30PnHTdQO.6zyDRjFASwdDW-ayaRAiTWMeqpRzQlBMyG3MzWg6VgOclmvkn6BdlvNooBrQg2aIfYeNs8WMQ8LGKgjtH6ADbmE00uWsKQJaAMCrxFROhUVLvYGa.T.KDiHMDR6.FPQ5TCG.GrUS95X4c1S1w0ln7W9UKVh-Q3T7Qr6kj9VbyvtkLVhMhVT5Gnk4dw01Xneb4eih8hK8qU5urejYRdeVW3iFTx.MModFQw2WfarrFoeyB.Sjc5lbYcFDce5QlLoDXV14faAz6WSylogVnkHdCP9oTOuGMDeC752tCZt36HWbXucBBseAmi5njcmdfpF//http%3A%2F%2Fwww.chris.com\\\" target=\\\"_blank\\\"><img style=\\\"border: 0;\\\" border=\\\"0\\\" width=\\\"300\\\" height=\\\"250\\\" src=\\\"http://test.360yield.com/file/226569/LeftAligned_blue.png\\\" alt=\\\"\\\"/></a><img src=\\\"http://dev.tokyo.iponweb.net/imp_pixel?ic=KqFxs3bhZwS9j9reQlSW5affOay54sEDsEqQzNMeQr0olHvVZJJVG8HOZ.mPgdCcksXTG1UvtBnYVxu2F0jlB76NSwEQaxULkEsUfXMPbKKkP8v0tLFkLeF1iDgO9bjAJmxyVYtIA4C-hGy80tDfcltIKfy1JNz-zf7E0XNHKo1T8yGugThU2Uo65uR1v8jsYEFh3VmpI2pUvQgKAspX.WLBmON8jCfPuHCZr2dpyVhJ50PBavKBsON0gcwc5iwNhiF-.RFbqkmAZOXtt1DluDjddZelUghV8FnKLV1OAaJvHeMaeSwMYEYs355-53R3szvp2s9yvFDTI9P5X9Z.a0uMtuXoHyqjUFn79MCnntwYtqPxu9Ho17jgB2w4HCI2qd3bhEJG04lC-pDMOUkrD19.-ivMBkdYVKgl-5b13gS2e9absDIuy.1YWsdex3PTGXDMr68kpHI9lisCMd7EEWLQep-J37l1HyVZqT63cPvpim3siP6smbiAiR8lzu6JUKHgglc0oYWAVBCL4cwA4qKKqvpRrL8xQ4vRG8V9DPI8\\\" alt=\\\" \\\" style=\\\"display:none\\\"/><improvedigital_ad_output_information tp_id=\\\"\\\" buyer_id=\\\"0\\\" rtb_advertiser=\\\"\\\" campaign_id=\\\"284945\\\" line_item_id=\\\"367603\\\" creative_id=\\\"456851\\\" crid=\\\"0\\\" placement_id=\\\"1071749\\\"></improvedigital_ad_output_information></body></html><div style=\\\"position: absolute; left: 0px; top: 0px; visibility: hidden;\\\"><img src=\\\"http://127.0.0.1:8080/rtb_gateway/handlers/client/track/?id=0a9348ab-973d-4596-9ee8-bafa4e5d0865\\\" border=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\" alt=\\\"\\\" style=\\\"display:none\\\"></div>", | ||
"w": 300, | ||
"h": 250, | ||
"id": "a5ec99e8-aa6b-42f4-bf8b-b68dabf96caf", | ||
"impid": "imp_id", | ||
"crid": "demo-475", | ||
"dealid": "demo-234", | ||
"price": 1.087, | ||
"ext": { | ||
"adType": "leaderboard", | ||
"adFormat": "superadformat" | ||
} | ||
}, | ||
"type": "banner" | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You're welcomed to include theses tests, but please know for test coverage we only look at the json tests since those include additional assertions for memory safety. So please be sure these cases are also covered by the json tests.
Nitpick: Please use table driven test design for these cases. Something like https://go.dev/wiki/TableDrivenTests. There are many examples in this code base.
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.
has been updated to make use of table driven test design