Skip to content

Commit 30c010e

Browse files
authored
Test: Bidder Specific Imp Level Params Should Apply to a Specific Alias (#4195)
1 parent 0519e56 commit 30c010e

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

src/test/groovy/org/prebid/server/functional/tests/ImpRequestSpec.groovy

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import static org.prebid.server.functional.model.bidder.BidderName.OPENX
1919
import static org.prebid.server.functional.model.bidder.BidderName.RUBICON
2020
import static org.prebid.server.functional.model.bidder.BidderName.UNKNOWN
2121
import static org.prebid.server.functional.model.bidder.BidderName.WILDCARD
22+
import static org.prebid.server.functional.model.bidder.BidderName.GENER_X
2223
import static org.prebid.server.functional.model.response.auction.ErrorType.PREBID
2324
import static org.prebid.server.functional.testcontainers.Dependencies.getNetworkServiceContainer
2425

@@ -131,6 +132,42 @@ class ImpRequestSpec extends BaseSpec {
131132
ALIAS_CAMEL_CASE | GENERIC_CAMEL_CASE
132133
}
133134

135+
def "PBS should update imp fields only for specific alias when request has multiple aliases"() {
136+
given: "Default basic BidRequest"
137+
def storedPmp = Pmp.defaultPmp
138+
def originalPmp = Pmp.defaultPmp
139+
def bidRequest = BidRequest.defaultBidRequest.tap {
140+
imp.first.tap {
141+
pmp = originalPmp
142+
ext.prebid.imp = [(aliasName): new Imp(pmp: storedPmp)]
143+
ext.prebid.bidder.generic = null
144+
ext.prebid.bidder.generX = new Generic()
145+
ext.prebid.bidder.alias = new Generic()
146+
}
147+
ext.prebid.aliases = [(GENER_X.value) : bidderName,
148+
(aliasName.value): bidderName,
149+
]
150+
}
151+
152+
when: "Requesting PBS auction"
153+
def response = defaultPbsService.sendAuctionRequest(bidRequest)
154+
155+
then: "BidderRequest should update imp information for specific alias"
156+
def bidderRequests = getRequests(response)
157+
assert bidderRequests.size() == 2
158+
assert bidderRequests[ALIAS.value].imp.pmp.flatten() == [storedPmp]
159+
160+
and: "Left original information for other"
161+
assert bidderRequests[GENER_X.value].imp.pmp.flatten() == [originalPmp]
162+
163+
where:
164+
aliasName | bidderName
165+
ALIAS | GENERIC
166+
ALIAS_CAMEL_CASE | GENERIC
167+
ALIAS | GENERIC_CAMEL_CASE
168+
ALIAS_CAMEL_CASE | GENERIC_CAMEL_CASE
169+
}
170+
134171
def "PBS shouldn't update imp fields when imp.ext.prebid.imp contain only bidder with invalid name"() {
135172
given: "Default basic BidRequest"
136173
def impPmp = Pmp.defaultPmp

src/test/groovy/org/prebid/server/functional/tests/privacy/GdprSetUidSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class GdprSetUidSpec extends PrivacyBaseSpec {
5858
.build()
5959
}
6060

61-
and: "Default uids cookie with gener_x bidder"
61+
and: "Default uids cookie with generic bidder"
6262
def uidsCookie = UidsCookie.defaultUidsCookie.tap {
6363
it.tempUIDs = [(GENERIC): defaultUidWithExpiry]
6464
}

0 commit comments

Comments
 (0)