-
Notifications
You must be signed in to change notification settings - Fork 187
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
Tests: Add adUnitCode to exception list #3599
Merged
osulzhenko
merged 6 commits into
add-adunitcode-to-exception-list
from
functional-tests/adunitcode-to-exception-list
Dec 17, 2024
+47
−6
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
00e342a
Tests: Add adUnitCode to exception list
osulzhenko 7e7c536
Merge branch 'refs/heads/add-adunitcode-to-exception-list' into funct…
osulzhenko e65fc12
update tests
osulzhenko 588837c
update tests
osulzhenko 1ed39a1
update functional test
osulzhenko b623edb
update functional test
osulzhenko 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
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
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
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 |
---|---|---|
|
@@ -789,15 +789,22 @@ class BidderParamsSpec extends BaseSpec { | |
gpid = PBSUtils.randomString | ||
skadn = PBSUtils.randomString | ||
tid = PBSUtils.randomString | ||
adUnitCode = PBSUtils.randomString | ||
} | ||
def bidRequest = BidRequest.defaultBidRequest.tap { | ||
imp[0].ext = impExt | ||
} | ||
|
||
when: "PBS processes auction request" | ||
defaultPbsService.sendAuctionRequest(bidRequest) | ||
def response = defaultPbsService.sendAuctionRequest(bidRequest) | ||
|
||
then: "Response shouldn't contain error" | ||
assert !response.ext?.errors | ||
|
||
then: "Bidder request should contain same field as requested" | ||
and: "Response shouldn't contain warning" | ||
assert !response.ext?.warnings | ||
|
||
and: "Bidder request should contain same field as requested" | ||
def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
verifyAll(bidderRequest.imp[0].ext) { | ||
bidder == impExt.generic | ||
|
@@ -809,7 +816,39 @@ class BidderParamsSpec extends BaseSpec { | |
gpid == impExt.gpid | ||
skadn == impExt.skadn | ||
tid == impExt.tid | ||
adUnitCode == impExt.adUnitCode | ||
} | ||
} | ||
|
||
def "PBS shouldn't emit warning and proceed auction when all ext.prebid.bidderParams fields known for PBS"() { | ||
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. Please correct test name, since for now sounds like we shouldn't proceed auction |
||
given: "Default bid request with populated ext.prebid.bidderParams" | ||
def genericBidderParams = PBSUtils.randomString | ||
def bidRequest = BidRequest.defaultBidRequest.tap { | ||
ext.prebid.bidderParams = [ae : PBSUtils.randomString, | ||
all : PBSUtils.randomString, | ||
context : PBSUtils.randomString, | ||
data : PBSUtils.randomString, | ||
general : PBSUtils.randomString, | ||
gpid : PBSUtils.randomString, | ||
skadn : PBSUtils.randomString, | ||
tid : PBSUtils.randomString, | ||
adunitcode : PBSUtils.randomString, | ||
(GENERIC.value): genericBidderParams | ||
] | ||
} | ||
|
||
when: "PBS processes auction request" | ||
def response = defaultPbsService.sendAuctionRequest(bidRequest) | ||
|
||
then: "Response shouldn't contain error" | ||
assert !response.ext?.errors | ||
|
||
and: "Response shouldn't contain warning" | ||
assert !response.ext?.warnings | ||
|
||
"Bidder request should bidderParams only for 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.
|
||
def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
assert bidderRequest.ext.prebid.bidderParams == [(GENERIC.value): genericBidderParams] | ||
} | ||
|
||
def "PBS should send request to bidder when adapters.bidder.meta-info.currency-accepted not specified"() { | ||
|
@@ -847,7 +886,7 @@ class BidderParamsSpec extends BaseSpec { | |
def "PBS should send request to bidder when adapters.bidder.aliases.bidder.meta-info.currency-accepted not specified"() { | ||
given: "PBS with adapter configuration" | ||
def pbsService = pbsServiceFactory.getService( | ||
"adapters.generic.aliases.alias.enabled" : "true", | ||
"adapters.generic.aliases.alias.enabled": "true", | ||
"adapters.generic.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString(), | ||
"adapters.generic.aliases.alias.meta-info.currency-accepted": "") | ||
|
||
|
@@ -955,7 +994,7 @@ class BidderParamsSpec extends BaseSpec { | |
def "PBS should send request to bidder when adapters.bidder.aliases.bidder.meta-info.currency-accepted intersect with requested currency"() { | ||
given: "PBS with adapter configuration" | ||
def pbsService = pbsServiceFactory.getService( | ||
"adapters.generic.aliases.alias.enabled" : "true", | ||
"adapters.generic.aliases.alias.enabled": "true", | ||
"adapters.generic.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString(), | ||
"adapters.generic.aliases.alias.meta-info.currency-accepted": "${USD},${EUR}".toString()) | ||
|
||
|
@@ -996,7 +1035,7 @@ class BidderParamsSpec extends BaseSpec { | |
def "PBS shouldn't send request to bidder and emit warning when adapters.bidder.aliases.bidder.meta-info.currency-accepted not intersect with requested currency"() { | ||
given: "PBS with adapter configuration" | ||
def pbsService = pbsServiceFactory.getService( | ||
"adapters.generic.aliases.alias.enabled" : "true", | ||
"adapters.generic.aliases.alias.enabled": "true", | ||
"adapters.generic.aliases.alias.endpoint": "$networkServiceContainer.rootUri/auction".toString(), | ||
"adapters.generic.aliases.alias.meta-info.currency-accepted": "${JPY},${CHF}".toString()) | ||
|
||
|
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.
Should be in
imp[].ext.prebid.adunitcode