-
Notifications
You must be signed in to change notification settings - Fork 253
Test: Bidder removal fields #4329
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
Changes from 5 commits
7e4ce74
1233b6c
5ca717c
c32bcc2
e73a6b0
34d4433
3b9796c
0f62f16
7f5f79e
1bb910d
ea0c3c0
1f171a9
15cdd97
f55bd7b
dc3d8e6
aa1f9c3
8ef28a5
9362d62
6fa3493
a5bfe1e
5200219
2ddc538
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 |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package org.prebid.server.functional.model.request | ||
|
|
||
| import groovy.transform.ToString | ||
| import org.prebid.server.functional.model.ChannelType | ||
|
|
||
| @ToString(includeNames = true, ignoreNulls = true) | ||
| class Channel { | ||
|
|
||
| ChannelType name | ||
| String version | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package org.prebid.server.functional.model.request.auction | ||
|
|
||
| import groovy.transform.EqualsAndHashCode | ||
| import groovy.transform.ToString | ||
|
|
||
| @EqualsAndHashCode | ||
| @ToString(includeNames = true, ignoreNulls = true) | ||
| class DevicePrebid { | ||
|
|
||
| Interstitial interstitial | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package org.prebid.server.functional.model.request.auction | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty | ||
| import groovy.transform.EqualsAndHashCode | ||
| import groovy.transform.ToString | ||
|
|
||
| @EqualsAndHashCode | ||
| @ToString(includeNames = true, ignoreNulls = true) | ||
| class Interstitial { | ||
|
|
||
| @JsonProperty("minwidthperc") | ||
| Integer minWidthPercentage | ||
| @JsonProperty("minheightperc") | ||
| Integer minHeightPercentage | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ import org.prebid.server.functional.service.PrebidServerException | |
| import org.prebid.server.functional.service.PrebidServerService | ||
| import org.prebid.server.functional.util.HttpUtil | ||
| import org.prebid.server.functional.util.PBSUtils | ||
| import spock.lang.IgnoreRest | ||
|
Collaborator
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. pls remove |
||
| import spock.lang.Shared | ||
|
|
||
| import static org.prebid.server.functional.model.AccountStatus.ACTIVE | ||
|
|
@@ -125,37 +126,6 @@ class AuctionSpec extends BaseSpec { | |
| "invalid-stored-impr" | { bidReq, storedReq -> bidReq.imp[0].ext.prebid.storedRequest = storedReq } | ||
| } | ||
|
|
||
| def "PBS should copy imp level passThrough to bidresponse.seatbid[].bid[].ext.prebid.passThrough when the passThrough is present"() { | ||
| given: "Default bid request with passThrough" | ||
| def randomString = PBSUtils.randomString | ||
| def passThrough = [(randomString): randomString] | ||
| def bidRequest = BidRequest.defaultBidRequest.tap { | ||
| imp[0].ext.prebid.passThrough = passThrough | ||
| } | ||
|
|
||
| when: "Requesting PBS auction" | ||
| def response = defaultPbsService.sendAuctionRequest(bidRequest) | ||
|
|
||
| then: "BidResponse should contain the same passThrough as on request" | ||
| assert response.seatbid.first().bid.first().ext.prebid.passThrough == passThrough | ||
| } | ||
|
|
||
| def "PBS should copy global level passThrough object to bidresponse.ext.prebid.passThrough when passThrough is present"() { | ||
| given: "Default bid request with passThrough" | ||
| def randomString = PBSUtils.randomString | ||
| def passThrough = [(randomString): randomString] | ||
| def bidRequest = BidRequest.defaultBidRequest.tap { | ||
| ext.prebid.passThrough = passThrough | ||
| } | ||
|
|
||
| when: "Requesting PBS auction" | ||
| defaultPbsService.sendAuctionRequest(bidRequest) | ||
|
|
||
| then: "BidResponse should contain the same passThrough as on request" | ||
| def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
| assert bidderRequest.ext.prebid.passThrough == passThrough | ||
| } | ||
|
|
||
| def "PBS should populate bidder request buyeruid from buyeruids when buyeruids with appropriate bidder present in request"() { | ||
| given: "Bid request with buyeruids" | ||
| def buyeruid = PBSUtils.randomString | ||
|
|
@@ -169,6 +139,9 @@ class AuctionSpec extends BaseSpec { | |
| then: "Bidder request should contain buyeruid from the user.ext.prebid.buyeruids" | ||
| def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
| assert bidderRequest?.user?.buyeruid == buyeruid | ||
|
|
||
| and: "Bidder request shouldn't contain user.ext.prebid.buyeruids" | ||
| assert !bidderRequest.user.ext.prebid.buyeruids | ||
| } | ||
|
|
||
| def "PBS shouldn't populate bidder request buyeruid from buyeruids when buyeruids without appropriate bidder present in request"() { | ||
|
|
@@ -336,25 +309,6 @@ class AuctionSpec extends BaseSpec { | |
| assert !bidderRequest.ext.prebid.aliases | ||
| } | ||
|
|
||
| def "PBS auction should pass ext.prebid.sdk requested to bidder request when sdk specified"() { | ||
| given: "Default bid request with aliases" | ||
| def bidRequest = BidRequest.defaultBidRequest.tap { | ||
| ext.prebid.sdk = new Sdk(renderers: [new Renderer( | ||
| name: PBSUtils.randomString, | ||
| version: PBSUtils.randomString, | ||
| data: new RendererData(any: PBSUtils.randomString))]) | ||
| } | ||
|
|
||
| when: "Requesting PBS auction" | ||
| defaultPbsService.sendAuctionRequest(bidRequest) | ||
|
|
||
| then: "Bidder request should contain sdk value same in request" | ||
| def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
| assert bidderRequest.ext.prebid.sdk.renderers.name == bidRequest.ext.prebid.sdk.renderers.name | ||
| assert bidderRequest.ext.prebid.sdk.renderers.version == bidRequest.ext.prebid.sdk.renderers.version | ||
| assert bidderRequest.ext.prebid.sdk.renderers.data.any == bidRequest.ext.prebid.sdk.renderers.data.any | ||
| } | ||
|
|
||
| def "PBS auction should pass meta object to bid response when meta specified "() { | ||
| given: "Default bid request with aliases" | ||
| def bidRequest = BidRequest.defaultBidRequest | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| package org.prebid.server.functional.tests | ||
|
|
||
|
|
||
| import org.prebid.server.functional.model.bidder.Generic | ||
| import org.prebid.server.functional.model.config.AccountAuctionConfig | ||
| import org.prebid.server.functional.model.config.AccountConfig | ||
|
|
@@ -53,6 +52,7 @@ import static org.prebid.server.functional.model.request.auction.VideoPlcmtSubty | |
| import static org.prebid.server.functional.model.response.auction.ErrorType.PREBID | ||
| import static org.prebid.server.functional.testcontainers.Dependencies.getNetworkServiceContainer | ||
| import static org.prebid.server.functional.util.PBSUtils.getRandomDecimal | ||
| import static org.prebid.server.functional.util.PBSUtils.roundDecimal | ||
|
|
||
| class BidAdjustmentSpec extends BaseSpec { | ||
|
|
||
|
|
@@ -96,13 +96,17 @@ class BidAdjustmentSpec extends BaseSpec { | |
| assert response?.seatbid?.first?.bid?.first?.price == bidResponse.seatbid.first.bid.first.price * | ||
| bidAdjustmentFactor | ||
|
|
||
| and: "Bidder request shouldn't contain bid adjustment factors" | ||
| def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
| assert !bidderRequest.ext.prebid.bidAdjustmentFactors | ||
|
|
||
| where: | ||
| bidAdjustmentFactor << [0.9, 1.1] | ||
| } | ||
|
|
||
| def "PBS should prefer bid price adjustment based on media type when request has per-media-type bid adjustment factors"() { | ||
| given: "Default bid request with bid adjustment" | ||
| def bidAdjustment = randomDecimal | ||
| def bidAdjustment = roundDecimal(getRandomDecimal(), 0) | ||
|
Collaborator
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. Why do we need to round here? |
||
| def mediaTypeBidAdjustment = bidAdjustmentFactor | ||
| def bidRequest = BidRequest.getDefaultBidRequest(SITE).tap { | ||
| ext.prebid.bidAdjustmentFactors = new BidAdjustmentFactors().tap { | ||
|
|
@@ -122,6 +126,10 @@ class BidAdjustmentSpec extends BaseSpec { | |
| assert response?.seatbid?.first?.bid?.first?.price == bidResponse.seatbid.first.bid.first.price * | ||
| mediaTypeBidAdjustment | ||
|
|
||
| and: "Bidder request should contain bid bid adjustment factors" | ||
| def bidderRequest = bidder.getBidderRequest(bidRequest.id) | ||
| assert bidderRequest.ext.prebid.bidAdjustmentFactors == bidRequest.ext.prebid.bidAdjustmentFactors | ||
|
|
||
| where: | ||
| bidAdjustmentFactor << [0.9, 1.1] | ||
|
Collaborator
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. can be change to mediaTypeBidAdjustment |
||
| } | ||
|
|
@@ -235,6 +243,9 @@ class BidAdjustmentSpec extends BaseSpec { | |
| assert bidderRequest.imp.bidFloorCur == [currency] | ||
| assert bidderRequest.imp.bidFloor == [impPrice] | ||
|
|
||
| and: "Bidder request should contain bid adjustments" | ||
| assert bidderRequest.ext.prebid.bidAdjustments == bidRequest.ext.prebid.bidAdjustments | ||
|
|
||
| where: | ||
| adjustmentType | ruleValue | mediaType | bidRequest | ||
| MULTIPLIER | getRandomDecimal(MIN_ADJUST_VALUE, MAX_MULTIPLIER_ADJUST_VALUE) | BANNER | BidRequest.defaultBidRequest | ||
|
|
||
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.
Never used