From 609bb8bd18a5d9cd720a49c2044ccabc44235725 Mon Sep 17 00:00:00 2001 From: markiian Date: Fri, 28 Nov 2025 16:20:28 +0200 Subject: [PATCH 1/2] Remove functional tests PAAPI feature --- .../model/config/AccountAuctionConfig.groovy | 2 - .../request/auction/AuctionEnvironment.groovy | 18 - .../model/request/auction/ImpExt.groovy | 4 - .../InterestGroupAuctionSupport.groovy | 11 - .../model/request/auction/PaaFormat.groovy | 13 - .../model/request/auction/Prebid.groovy | 1 - .../response/auction/BidResponseExt.groovy | 3 - .../auction/InterestGroupAuctionBuyer.groovy | 17 - .../InterestGroupAuctionBuyerExt.groovy | 10 - .../auction/InterestGroupAuctionIntent.groovy | 18 - .../InterestGroupAuctionIntentExt.groovy | 11 - .../auction/InterestGroupAuctionSeller.groovy | 14 - .../InterestGroupAuctionSellerExt.groovy | 10 - .../functional/tests/BidderParamsSpec.groovy | 68 -- .../tests/bidder/openx/OpenxSpec.groovy | 581 ------------------ 15 files changed, 781 deletions(-) delete mode 100644 src/test/groovy/org/prebid/server/functional/model/request/auction/AuctionEnvironment.groovy delete mode 100644 src/test/groovy/org/prebid/server/functional/model/request/auction/InterestGroupAuctionSupport.groovy delete mode 100644 src/test/groovy/org/prebid/server/functional/model/request/auction/PaaFormat.groovy delete mode 100644 src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionBuyer.groovy delete mode 100644 src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionBuyerExt.groovy delete mode 100644 src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionIntent.groovy delete mode 100644 src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionIntentExt.groovy delete mode 100644 src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionSeller.groovy delete mode 100644 src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionSellerExt.groovy delete mode 100644 src/test/groovy/org/prebid/server/functional/tests/bidder/openx/OpenxSpec.groovy diff --git a/src/test/groovy/org/prebid/server/functional/model/config/AccountAuctionConfig.groovy b/src/test/groovy/org/prebid/server/functional/model/config/AccountAuctionConfig.groovy index 2dc5ff7c77b..5e66ff24f7e 100644 --- a/src/test/groovy/org/prebid/server/functional/model/config/AccountAuctionConfig.groovy +++ b/src/test/groovy/org/prebid/server/functional/model/config/AccountAuctionConfig.groovy @@ -7,7 +7,6 @@ import groovy.transform.ToString import org.prebid.server.functional.model.bidder.BidderName import org.prebid.server.functional.model.request.auction.BidAdjustment import org.prebid.server.functional.model.request.auction.BidRounding -import org.prebid.server.functional.model.request.auction.PaaFormat import org.prebid.server.functional.model.request.auction.Targeting import org.prebid.server.functional.model.response.auction.MediaType @@ -28,7 +27,6 @@ class AccountAuctionConfig { AccountPriceFloorsConfig priceFloors AccountProfilesConfigs profiles Targeting targeting - PaaFormat paaformat @JsonProperty("preferredmediatype") Map preferredMediaType @JsonProperty("privacysandbox") diff --git a/src/test/groovy/org/prebid/server/functional/model/request/auction/AuctionEnvironment.groovy b/src/test/groovy/org/prebid/server/functional/model/request/auction/AuctionEnvironment.groovy deleted file mode 100644 index 649c539e794..00000000000 --- a/src/test/groovy/org/prebid/server/functional/model/request/auction/AuctionEnvironment.groovy +++ /dev/null @@ -1,18 +0,0 @@ -package org.prebid.server.functional.model.request.auction - -import com.fasterxml.jackson.annotation.JsonValue - -enum AuctionEnvironment { - - NOT_SUPPORTED(0), - DEVICE_ORCHESTRATED(1), - SERVER_ORCHESTRATED(3), - UNKNOWN(Integer.MAX_VALUE), - - @JsonValue - private int value - - AuctionEnvironment(Integer value) { - this.value = value - } -} diff --git a/src/test/groovy/org/prebid/server/functional/model/request/auction/ImpExt.groovy b/src/test/groovy/org/prebid/server/functional/model/request/auction/ImpExt.groovy index a9d72718e9a..8632cb113d0 100644 --- a/src/test/groovy/org/prebid/server/functional/model/request/auction/ImpExt.groovy +++ b/src/test/groovy/org/prebid/server/functional/model/request/auction/ImpExt.groovy @@ -23,13 +23,9 @@ class ImpExt { String tid String gpid String sid - @JsonProperty("ae") - AuctionEnvironment auctionEnvironment String all String skadn String general - @JsonProperty("igs") - InterestGroupAuctionSupport interestGroupAuctionSupports AnyUnsupportedBidder anyUnsupportedBidder static ImpExt getDefaultImpExt() { diff --git a/src/test/groovy/org/prebid/server/functional/model/request/auction/InterestGroupAuctionSupport.groovy b/src/test/groovy/org/prebid/server/functional/model/request/auction/InterestGroupAuctionSupport.groovy deleted file mode 100644 index 31d3628587d..00000000000 --- a/src/test/groovy/org/prebid/server/functional/model/request/auction/InterestGroupAuctionSupport.groovy +++ /dev/null @@ -1,11 +0,0 @@ -package org.prebid.server.functional.model.request.auction - -import com.fasterxml.jackson.annotation.JsonProperty -import groovy.transform.ToString - -@ToString(includeNames = true, ignoreNulls = true) -class InterestGroupAuctionSupport { - - @JsonProperty("ae") - AuctionEnvironment auctionEnvironment -} diff --git a/src/test/groovy/org/prebid/server/functional/model/request/auction/PaaFormat.groovy b/src/test/groovy/org/prebid/server/functional/model/request/auction/PaaFormat.groovy deleted file mode 100644 index 79f41e953fe..00000000000 --- a/src/test/groovy/org/prebid/server/functional/model/request/auction/PaaFormat.groovy +++ /dev/null @@ -1,13 +0,0 @@ -package org.prebid.server.functional.model.request.auction - -import com.fasterxml.jackson.annotation.JsonValue - -enum PaaFormat { - - ORIGINAL, IAB, INVALID - - @JsonValue - String getValue() { - name().toLowerCase() - } -} diff --git a/src/test/groovy/org/prebid/server/functional/model/request/auction/Prebid.groovy b/src/test/groovy/org/prebid/server/functional/model/request/auction/Prebid.groovy index 23b4e7f87a5..64dba038b8f 100644 --- a/src/test/groovy/org/prebid/server/functional/model/request/auction/Prebid.groovy +++ b/src/test/groovy/org/prebid/server/functional/model/request/auction/Prebid.groovy @@ -42,7 +42,6 @@ class Prebid { PrebidModulesConfig modules PrebidAnalytics analytics StoredAuctionResponse storedAuctionResponse - PaaFormat paaFormat @JsonProperty("alternatebiddercodes") AlternateBidderCodes alternateBidderCodes @JsonProperty("profiles") diff --git a/src/test/groovy/org/prebid/server/functional/model/response/auction/BidResponseExt.groovy b/src/test/groovy/org/prebid/server/functional/model/response/auction/BidResponseExt.groovy index d1d282d663a..3ccb3384e89 100644 --- a/src/test/groovy/org/prebid/server/functional/model/response/auction/BidResponseExt.groovy +++ b/src/test/groovy/org/prebid/server/functional/model/response/auction/BidResponseExt.groovy @@ -1,6 +1,5 @@ package org.prebid.server.functional.model.response.auction -import com.fasterxml.jackson.annotation.JsonProperty import groovy.transform.ToString import org.prebid.server.functional.model.response.BidderError import org.prebid.server.functional.model.response.Debug @@ -16,6 +15,4 @@ class BidResponseExt { Map usersync BidResponsePrebid prebid Map> warnings - @JsonProperty("igi") - List interestGroupAuctionIntent } diff --git a/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionBuyer.groovy b/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionBuyer.groovy deleted file mode 100644 index b8d1bf80d38..00000000000 --- a/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionBuyer.groovy +++ /dev/null @@ -1,17 +0,0 @@ -package org.prebid.server.functional.model.response.auction - -import com.fasterxml.jackson.databind.PropertyNamingStrategies -import com.fasterxml.jackson.databind.annotation.JsonNaming -import groovy.transform.ToString -import org.prebid.server.functional.model.Currency - -@ToString(includeNames = true, ignoreNulls = true) -@JsonNaming(PropertyNamingStrategies.LowerCaseStrategy) -class InterestGroupAuctionBuyer { - - String origin - BigDecimal maxBid - Currency cur - Map pbs - InterestGroupAuctionBuyerExt ext -} diff --git a/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionBuyerExt.groovy b/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionBuyerExt.groovy deleted file mode 100644 index 4404491246c..00000000000 --- a/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionBuyerExt.groovy +++ /dev/null @@ -1,10 +0,0 @@ -package org.prebid.server.functional.model.response.auction - -import groovy.transform.ToString - -@ToString(includeNames = true, ignoreNulls = true) -class InterestGroupAuctionBuyerExt { - - String bidder - String adapter -} diff --git a/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionIntent.groovy b/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionIntent.groovy deleted file mode 100644 index 29ff15d4eeb..00000000000 --- a/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionIntent.groovy +++ /dev/null @@ -1,18 +0,0 @@ -package org.prebid.server.functional.model.response.auction - -import com.fasterxml.jackson.annotation.JsonProperty -import com.fasterxml.jackson.databind.PropertyNamingStrategies -import com.fasterxml.jackson.databind.annotation.JsonNaming -import groovy.transform.ToString - -@ToString(includeNames = true, ignoreNulls = true) -@JsonNaming(PropertyNamingStrategies.LowerCaseStrategy) -class InterestGroupAuctionIntent { - - String impId - @JsonProperty("igb") - List interestGroupAuctionBuyer - @JsonProperty("igs") - List interestGroupAuctionSeller - InterestGroupAuctionIntentExt ext -} diff --git a/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionIntentExt.groovy b/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionIntentExt.groovy deleted file mode 100644 index 29aeaf980da..00000000000 --- a/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionIntentExt.groovy +++ /dev/null @@ -1,11 +0,0 @@ -package org.prebid.server.functional.model.response.auction - -import groovy.transform.ToString -import org.prebid.server.functional.model.bidder.BidderName - -@ToString(includeNames = true, ignoreNulls = true) -class InterestGroupAuctionIntentExt { - - BidderName bidder - BidderName adapter -} diff --git a/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionSeller.groovy b/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionSeller.groovy deleted file mode 100644 index 192f5c2f611..00000000000 --- a/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionSeller.groovy +++ /dev/null @@ -1,14 +0,0 @@ -package org.prebid.server.functional.model.response.auction - -import com.fasterxml.jackson.databind.PropertyNamingStrategies -import com.fasterxml.jackson.databind.annotation.JsonNaming -import groovy.transform.ToString - -@ToString(includeNames = true, ignoreNulls = true) -@JsonNaming(PropertyNamingStrategies.LowerCaseStrategy) -class InterestGroupAuctionSeller { - - String impId - Map config - InterestGroupAuctionSellerExt ext -} diff --git a/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionSellerExt.groovy b/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionSellerExt.groovy deleted file mode 100644 index fcecf1b5480..00000000000 --- a/src/test/groovy/org/prebid/server/functional/model/response/auction/InterestGroupAuctionSellerExt.groovy +++ /dev/null @@ -1,10 +0,0 @@ -package org.prebid.server.functional.model.response.auction - -import groovy.transform.ToString - -@ToString(includeNames = true, ignoreNulls = true) -class InterestGroupAuctionSellerExt { - - String bidder - String adapter -} diff --git a/src/test/groovy/org/prebid/server/functional/tests/BidderParamsSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/BidderParamsSpec.groovy index 220585f008f..4953cb97eb4 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/BidderParamsSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/BidderParamsSpec.groovy @@ -9,7 +9,6 @@ import org.prebid.server.functional.model.db.StoredRequest import org.prebid.server.functional.model.request.amp.AmpRequest import org.prebid.server.functional.model.request.auction.Adrino import org.prebid.server.functional.model.request.auction.Amx -import org.prebid.server.functional.model.request.auction.AuctionEnvironment import org.prebid.server.functional.model.request.auction.Banner import org.prebid.server.functional.model.request.auction.BidRequest import org.prebid.server.functional.model.request.auction.Device @@ -19,7 +18,6 @@ import org.prebid.server.functional.model.request.auction.Imp import org.prebid.server.functional.model.request.auction.ImpExt import org.prebid.server.functional.model.request.auction.ImpExtContext import org.prebid.server.functional.model.request.auction.ImpExtContextData -import org.prebid.server.functional.model.request.auction.InterestGroupAuctionSupport import org.prebid.server.functional.model.request.auction.Native import org.prebid.server.functional.model.request.auction.PrebidOptions import org.prebid.server.functional.model.request.auction.PrebidStoredRequest @@ -47,10 +45,6 @@ import static org.prebid.server.functional.model.bidder.BidderName.OPENX import static org.prebid.server.functional.model.bidder.CompressionType.GZIP import static org.prebid.server.functional.model.bidder.CompressionType.NONE import static org.prebid.server.functional.model.request.auction.Asset.titleAsset -import static org.prebid.server.functional.model.request.auction.AuctionEnvironment.DEVICE_ORCHESTRATED -import static org.prebid.server.functional.model.request.auction.AuctionEnvironment.NOT_SUPPORTED -import static org.prebid.server.functional.model.request.auction.AuctionEnvironment.SERVER_ORCHESTRATED -import static org.prebid.server.functional.model.request.auction.AuctionEnvironment.UNKNOWN import static org.prebid.server.functional.model.request.auction.DistributionChannel.APP import static org.prebid.server.functional.model.request.auction.DistributionChannel.DOOH import static org.prebid.server.functional.model.request.auction.DistributionChannel.SITE @@ -1250,68 +1244,6 @@ class BidderParamsSpec extends BaseSpec { pbsServiceFactory.removeContainer(pbsConfig) } - def "PBS should add auction environment to imp.ext.igs when it is present in imp.ext and imp.ext.igs is empty"() { - given: "Default bid request with populated imp.ext" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.tap { - auctionEnvironment = requestedAuctionEnvironment - interestGroupAuctionSupports = new InterestGroupAuctionSupport(auctionEnvironment: null) - } - } - - when: "PBS processes auction request" - defaultPbsService.sendAuctionRequest(bidRequest) - - then: "Bidder request should imp[].{ae/ext.igs.ae} same value as requested" - def bidderRequest = bidder.getBidderRequest(bidRequest.id) - assert bidderRequest.imp[0].ext.auctionEnvironment == requestedAuctionEnvironment - assert bidderRequest.imp[0].ext.interestGroupAuctionSupports.auctionEnvironment == requestedAuctionEnvironment - - where: - requestedAuctionEnvironment << [NOT_SUPPORTED, DEVICE_ORCHESTRATED] - } - - def "PBS shouldn't add unsupported auction environment to imp.ext.igs when it is present in imp.ext and imp.ext.igs is empty"() { - given: "Default bid request with populated imp.ext" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.tap { - auctionEnvironment = requestedAuctionEnvironment - interestGroupAuctionSupports = new InterestGroupAuctionSupport(auctionEnvironment: null) - } - } - - when: "PBS processes auction request" - defaultPbsService.sendAuctionRequest(bidRequest) - - then: "Bidder request should imp[].ae same value as requested" - def bidderRequest = bidder.getBidderRequest(bidRequest.id) - assert bidderRequest.imp[0].ext.auctionEnvironment == requestedAuctionEnvironment - assert !bidderRequest.imp[0].ext.interestGroupAuctionSupports.auctionEnvironment - - where: - requestedAuctionEnvironment << [SERVER_ORCHESTRATED, UNKNOWN] - } - - def "PBS shouldn't change auction environment in imp.ext.igs when it is present in both imp.ext and imp.ext.igs"() { - given: "Default bid request with populated imp.ext" - def extAuctionEnv = PBSUtils.getRandomEnum(AuctionEnvironment, [SERVER_ORCHESTRATED, UNKNOWN]) - def extIgsAuctionEnv = PBSUtils.getRandomEnum(AuctionEnvironment, [SERVER_ORCHESTRATED, UNKNOWN]) - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.tap { - auctionEnvironment = extAuctionEnv - interestGroupAuctionSupports = new InterestGroupAuctionSupport(auctionEnvironment: extIgsAuctionEnv) - } - } - - when: "PBS processes auction request" - defaultPbsService.sendAuctionRequest(bidRequest) - - then: "Bidder request should imp[].{ae/ext.igs.ae} same value as requested" - def bidderRequest = bidder.getBidderRequest(bidRequest.id) - assert bidderRequest.imp[0].ext.auctionEnvironment == extAuctionEnv - assert bidderRequest.imp[0].ext.interestGroupAuctionSupports.auctionEnvironment == extIgsAuctionEnv - } - def "PBS should reject alias bidders when bidder params from request doesn't satisfy own json-schema"() { given: "Default bid request" def bidRequest = BidRequest.defaultBidRequest.tap { diff --git a/src/test/groovy/org/prebid/server/functional/tests/bidder/openx/OpenxSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/bidder/openx/OpenxSpec.groovy deleted file mode 100644 index 97a0015cea5..00000000000 --- a/src/test/groovy/org/prebid/server/functional/tests/bidder/openx/OpenxSpec.groovy +++ /dev/null @@ -1,581 +0,0 @@ -package org.prebid.server.functional.tests.bidder.openx - -import org.prebid.server.functional.model.Currency -import org.prebid.server.functional.model.bidder.Openx -import org.prebid.server.functional.model.config.AccountAuctionConfig -import org.prebid.server.functional.model.config.AccountConfig -import org.prebid.server.functional.model.db.Account -import org.prebid.server.functional.model.request.auction.AuctionEnvironment -import org.prebid.server.functional.model.request.auction.BidRequest -import org.prebid.server.functional.model.request.auction.InterestGroupAuctionSupport -import org.prebid.server.functional.model.request.auction.PaaFormat -import org.prebid.server.functional.model.response.auction.InterestGroupAuctionBuyer -import org.prebid.server.functional.model.response.auction.InterestGroupAuctionBuyerExt -import org.prebid.server.functional.model.response.auction.InterestGroupAuctionIntent -import org.prebid.server.functional.model.response.auction.InterestGroupAuctionSeller -import org.prebid.server.functional.model.response.auction.OpenxBidResponse -import org.prebid.server.functional.model.response.auction.OpenxBidResponseExt -import org.prebid.server.functional.service.PrebidServerException -import org.prebid.server.functional.service.PrebidServerService -import org.prebid.server.functional.tests.BaseSpec -import org.prebid.server.functional.util.PBSUtils -import spock.lang.Shared - -import java.time.Instant - -import static org.prebid.server.functional.model.bidder.BidderName.OPENX -import static org.prebid.server.functional.model.bidder.BidderName.OPENX_ALIAS -import static org.prebid.server.functional.model.bidder.BidderName.WILDCARD -import static org.prebid.server.functional.model.request.auction.AuctionEnvironment.DEVICE_ORCHESTRATED -import static org.prebid.server.functional.model.request.auction.AuctionEnvironment.NOT_SUPPORTED -import static org.prebid.server.functional.model.request.auction.AuctionEnvironment.SERVER_ORCHESTRATED -import static org.prebid.server.functional.model.request.auction.AuctionEnvironment.UNKNOWN -import static org.prebid.server.functional.model.request.auction.PaaFormat.IAB -import static org.prebid.server.functional.model.request.auction.PaaFormat.ORIGINAL -import static org.prebid.server.functional.model.response.auction.ErrorType.PREBID -import static org.prebid.server.functional.testcontainers.Dependencies.networkServiceContainer - -class OpenxSpec extends BaseSpec { - - private static final Map OPENX_CONFIG = ["adapters.openx.enabled" : "true", - "adapters.openx.endpoint": "$networkServiceContainer.rootUri/auction".toString()] - private static final Map OPENX_ALIAS_CONFIG = ["adapters.openx.aliases.openxalias.enabled" : "true", - "adapters.openx.aliases.openxalias.endpoint": "$networkServiceContainer.rootUri/auction".toString()] - - @Shared - PrebidServerService pbsService = pbsServiceFactory.getService(OPENX_CONFIG) - - @Override - def cleanupSpec() { - pbsServiceFactory.removeContainer(OPENX_CONFIG) - pbsServiceFactory.removeContainer(OPENX_CONFIG + OPENX_ALIAS_CONFIG) - } - - def "PBS should populate fledge config by default when bid response with fledge"() { - given: "Default basic BidRequest with ae and openx bidder" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.auctionEnvironment = DEVICE_ORCHESTRATED - imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx - } - - and: "Default bid response with fledge config" - def impId = bidRequest.imp[0].id - def fledgeConfig = [(PBSUtils.randomString): PBSUtils.randomString] - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest, OPENX).tap { - ext = new OpenxBidResponseExt().tap { - fledgeAuctionConfigs = [(impId): fledgeConfig] - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - when: "PBS processes auction request" - def response = pbsService.sendAuctionRequest(bidRequest) - - then: "PBS response should contain fledge config" - def auctionConfigs = response.ext?.prebid?.fledge?.auctionConfigs - assert auctionConfigs?.size() == 1 - assert auctionConfigs[0].impId == impId - assert auctionConfigs[0].bidder == bidResponse.seatbid[0].seat.value - assert auctionConfigs[0].adapter == bidResponse.seatbid[0].seat.value - assert auctionConfigs[0].config == fledgeConfig - - and: "PBS response shouldn't contain igb config" - assert !response.ext?.interestGroupAuctionIntent?.interestGroupAuctionBuyer - - and: "PBS response shouldn't contain igs config" - assert !response.ext?.interestGroupAuctionIntent?.interestGroupAuctionSeller - } - - def "PBS should populate fledge config when bid response with fledge and ext.prebid.paaFormat = ORIGINAL"() { - given: "Default basic BidRequest with ae and openx bidder" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.auctionEnvironment = DEVICE_ORCHESTRATED - imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx - ext.prebid.paaFormat = ORIGINAL - } - - and: "Default bid response with fledge config" - def impId = bidRequest.imp[0].id - def fledgeConfig = [(PBSUtils.randomString): PBSUtils.randomString] - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest, OPENX).tap { - ext = new OpenxBidResponseExt().tap { - fledgeAuctionConfigs = [(impId): fledgeConfig] - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - when: "PBS processes auction request" - def response = pbsService.sendAuctionRequest(bidRequest) - - then: "PBS response should contain fledge config" - def auctionConfigs = response.ext?.prebid?.fledge?.auctionConfigs - assert auctionConfigs?.size() == 1 - assert auctionConfigs[0].impId == impId - assert auctionConfigs[0].bidder == bidResponse.seatbid[0].seat.value - assert auctionConfigs[0].adapter == bidResponse.seatbid[0].seat.value - assert auctionConfigs[0].config == fledgeConfig - - and: "PBS response shouldn't contain igb config" - assert !response.ext?.interestGroupAuctionIntent?.interestGroupAuctionBuyer - - and: "PBS response shouldn't contain igs config" - assert !response.ext?.interestGroupAuctionIntent?.interestGroupAuctionSeller - } - - def "PBS should take precedence request paa format over account value when both specified"() { - given: "Default bid request with openx" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx - ext.prebid.paaFormat = IAB - } - - and: "Default bid response with fledge config" - def impId = bidRequest.imp[0].id - def fledgeConfig = [(PBSUtils.randomString): PBSUtils.randomString] - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest).tap { - ext = new OpenxBidResponseExt().tap { - fledgeAuctionConfigs = [(impId): fledgeConfig] - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - and: "Save account in the DB" - def accountConfig = new AccountConfig(auction: new AccountAuctionConfig(paaformat: ORIGINAL)) - def account = new Account(uuid: bidRequest.site.publisher.id, config: accountConfig) - accountDao.save(account) - - when: "PBS processes auction request" - def response = pbsService.sendAuctionRequest(bidRequest) - - then: "PBS response shouldn't contain fledge config" - assert !response.ext?.prebid?.fledge?.auctionConfigs - - and: "PBS response should contain igs config" - def interestGroupAuctionSeller = response.ext.interestGroupAuctionIntent[0].interestGroupAuctionSeller[0] - assert interestGroupAuctionSeller.impId == impId - assert interestGroupAuctionSeller.config == fledgeConfig - assert interestGroupAuctionSeller.ext.bidder == bidResponse.seatbid[0].seat.value - assert interestGroupAuctionSeller.ext.adapter == bidResponse.seatbid[0].seat.value - - and: "PBS response shouldn't contain igb config" - assert !response.ext?.interestGroupAuctionIntent?[0]?.interestGroupAuctionBuyer - } - - def "PBS shouldn't populate fledge config when bid response with fledge and ext.prebid.paaFormat = IAB"() { - given: "Default basic BidRequest without ae" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.auctionEnvironment = NOT_SUPPORTED - imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx - ext.prebid.paaFormat = IAB - } - - and: "Default bid response" - def impId = bidRequest.imp[0].id - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest).tap { - ext = new OpenxBidResponseExt().tap { - fledgeAuctionConfigs = [(impId): [(PBSUtils.randomString): PBSUtils.randomString]] - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - when: "PBS processes auction request" - def response = pbsService.sendAuctionRequest(bidRequest) - - then: "PBS response shouldn't contain fledge config" - assert !response.ext.prebid.fledge - - and: "PBS response shouldn't contain igb config" - assert !response.ext?.interestGroupAuctionIntent?[0]?.interestGroupAuctionBuyer - - and: "PBS response should contain igs config" - def interestGroupAuctionSeller = response.ext.interestGroupAuctionIntent[0].interestGroupAuctionSeller[0] - assert interestGroupAuctionSeller.impId == impId - assert interestGroupAuctionSeller.config - assert interestGroupAuctionSeller.ext.bidder == bidResponse.seatbid[0].seat.value - assert interestGroupAuctionSeller.ext.adapter == bidResponse.seatbid[0].seat.value - } - - def "PBS shouldn't populate fledge config when bid response didn't return fledge config"() { - given: "Default basic BidRequest without ae" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx - } - - and: "Default bid response" - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest).tap { - ext = new OpenxBidResponseExt().tap { - fledgeAuctionConfigs = null - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - when: "PBS processes auction request" - def response = pbsService.sendAuctionRequest(bidRequest) - - then: "PBS response shouldn't contain fledge config" - assert !response.ext.prebid.fledge - - and: "PBS response shouldn't contain igi config" - assert !response?.ext?.interestGroupAuctionIntent - } - - def "PBS should populate fledge and iab output config when bid response with fledge and paa formant IAB"() { - given: "Default bid request with openx" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx - ext.prebid.paaFormat = requestPaaFormant - } - - and: "Default bid response with fledge config" - def impId = bidRequest.imp[0].id - def fledgeConfig = [(PBSUtils.randomString): PBSUtils.randomString] - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest).tap { - ext = new OpenxBidResponseExt().tap { - fledgeAuctionConfigs = [(impId): fledgeConfig] - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - and: "Save account in the DB" - def accountConfig = new AccountConfig(auction: new AccountAuctionConfig(paaformat: accountPaaFormat)) - def account = new Account(uuid: bidRequest.site.publisher.id, config: accountConfig) - accountDao.save(account) - - when: "PBS processes auction request" - def response = pbsService.sendAuctionRequest(bidRequest) - - then: "PBS response shouldn't contain fledge config" - assert !response.ext?.prebid?.fledge?.auctionConfigs - - and: "PBS response should contain igs config" - def interestGroupAuctionSeller = response.ext.interestGroupAuctionIntent[0].interestGroupAuctionSeller[0] - assert interestGroupAuctionSeller.impId == impId - assert interestGroupAuctionSeller.config == fledgeConfig - assert interestGroupAuctionSeller.ext.bidder == bidResponse.seatbid[0].seat.value - assert interestGroupAuctionSeller.ext.adapter == bidResponse.seatbid[0].seat.value - - and: "PBS response shouldn't contain igb config" - assert !response.ext?.interestGroupAuctionIntent?[0]?.interestGroupAuctionBuyer - - where: - accountPaaFormat | requestPaaFormant - IAB | IAB - null | IAB - IAB | null - } - - def "PBS should populate fledge config by default when bid response with fledge and requested aliases"() { - given: "PBS config with alias config" - def pbsService = pbsServiceFactory.getService(OPENX_CONFIG + OPENX_ALIAS_CONFIG) - - and: "Default basic BidRequest with ae and bidder" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.auctionEnvironment = DEVICE_ORCHESTRATED - imp[0].ext.prebid.bidder.generic = null - imp[0].ext.prebid.bidder.openxAlias = Openx.defaultOpenx - ext.prebid.aliases = [(OPENX_ALIAS.value): OPENX] - } - - and: "Default bid response with fledge config" - def impId = bidRequest.imp[0].id - def fledgeConfig = [(PBSUtils.randomString): PBSUtils.randomString] - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest, OPENX_ALIAS).tap { - ext = new OpenxBidResponseExt().tap { - fledgeAuctionConfigs = [(impId): fledgeConfig] - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - when: "PBS processes auction request" - def response = pbsService.sendAuctionRequest(bidRequest) - - then: "PBS response should contain fledge config" - def auctionConfigs = response.ext?.prebid?.fledge?.auctionConfigs - assert auctionConfigs?.size() == 1 - assert auctionConfigs[0].impId == impId - assert auctionConfigs[0].bidder == OPENX_ALIAS.value - assert auctionConfigs[0].adapter == OPENX_ALIAS.value - assert auctionConfigs[0].config == fledgeConfig - - and: "PBS response shouldn't contain igi config" - assert !response.ext?.interestGroupAuctionIntent - } - - def "PBS should populate iab config when bid response with fledge and requested aliases"() { - given: "PBS config" - def pbsService = pbsServiceFactory.getService(OPENX_CONFIG + OPENX_ALIAS_CONFIG) - - and: "Default basic BidRequest with ae and openx bidder" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.auctionEnvironment = DEVICE_ORCHESTRATED - imp[0].ext.prebid.bidder.generic = null - imp[0].ext.prebid.bidder.openxAlias = Openx.defaultOpenx - ext.prebid.aliases = [(OPENX_ALIAS.value): OPENX] - ext.prebid.paaFormat = IAB - } - - and: "Default bid response with fledge config" - def impId = bidRequest.imp[0].id - def fledgeConfig = [(PBSUtils.randomString): PBSUtils.randomString] - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest, OPENX_ALIAS).tap { - ext = new OpenxBidResponseExt().tap { - fledgeAuctionConfigs = [(impId): fledgeConfig] - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - when: "PBS processes auction request" - def response = pbsService.sendAuctionRequest(bidRequest) - - then: "PBS response shouldn't contain fledge config" - assert !response.ext?.prebid?.fledge?.auctionConfigs - - and: "PBS response should contain igs config" - def interestGroupAuctionSeller = response.ext.interestGroupAuctionIntent[0].interestGroupAuctionSeller[0] - assert interestGroupAuctionSeller.impId == impId - assert interestGroupAuctionSeller.config == fledgeConfig - assert interestGroupAuctionSeller.ext.bidder == OPENX_ALIAS.value - assert interestGroupAuctionSeller.ext.adapter == OPENX_ALIAS.value - - and: "Response should contain seat" - assert response.seatbid[0].seat == OPENX_ALIAS - - and: "Response should contain seat" - assert response.seatbid[0].bid[0].ext.prebid.meta.adapterCode == OPENX_ALIAS - - and: "PBS response shouldn't contain igi config" - assert !response.ext?.interestGroupAuctionIntent?[0].interestGroupAuctionBuyer - } - - def "PBS should populate fledge config by default when bid response with fledge and imp mismatched"() { - given: "Default basic BidRequest with ae and openx bidder" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.auctionEnvironment = DEVICE_ORCHESTRATED - imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx - } - - and: "Default bid response with fledge config" - def fledgeConfig = [(PBSUtils.randomString): PBSUtils.randomString] - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest, OPENX).tap { - ext = new OpenxBidResponseExt().tap { - fledgeAuctionConfigs = [(fledgeImpId): fledgeConfig] - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - when: "PBS processes auction request" - def response = pbsService.sendAuctionRequest(bidRequest) - - then: "PBS response should contain fledge config" - def auctionConfigs = response.ext?.prebid?.fledge?.auctionConfigs - assert auctionConfigs?.size() == 1 - assert auctionConfigs[0].impId == fledgeImpId - assert auctionConfigs[0].bidder == bidResponse.seatbid[0].seat.value - assert auctionConfigs[0].adapter == bidResponse.seatbid[0].seat.value - assert auctionConfigs[0].config == fledgeConfig - - and: "PBS response shouldn't contain igi config" - assert !response.ext?.interestGroupAuctionIntent - - where: - fledgeImpId << [PBSUtils.randomString, PBSUtils.randomNumber as String, WILDCARD.value] - } - - def "PBS should log error and not populated fledge impId when bidder respond with not empty config, but an empty impid"() { - given: "Start time" - def startTime = Instant.now() - - and: "Default basic BidRequest with ae and openx bidder" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.auctionEnvironment = DEVICE_ORCHESTRATED - imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx - ext.prebid.paaFormat = IAB - } - - and: "Default bid response with fledge config without imp" - def fledgeConfig = [(PBSUtils.randomString): PBSUtils.randomString] - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest, OPENX).tap { - ext = new OpenxBidResponseExt().tap { - fledgeAuctionConfigs = [(""): fledgeConfig] as Map - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - and: "Flush metrics" - flushMetrics(pbsService) - - when: "PBS processes auction request" - def response = pbsService.sendAuctionRequest(bidRequest) - - then: "PBS response shouldn't contain fledge config" - assert !response.ext?.prebid?.fledge?.auctionConfigs - - and: "PBS response shouldn't contain igi config" - assert !response.ext?.interestGroupAuctionIntent - - and: "PBS log should contain error" - def logs = pbsService.getLogsByTime(startTime) - assert getLogsByText(logs, "ExtIgiIgs with absent impId from bidder: ${OPENX.value}") - - and: "Bid response should contain warning" - assert response.ext.warnings[PREBID]?.code == [999] - assert response.ext.warnings[PREBID]?.message == - ["ExtIgiIgs with absent impId from bidder: ${OPENX.value}" as String] - - and: "Alert.general metric should be updated" - def metrics = pbsService.sendCollectedMetricsRequest() - assert metrics[ALERT_GENERAL] == 1 - } - - def "PBS shouldn't populate fledge or igi config when bidder respond with igb"() { - given: "Default basic BidRequest with ae and openx bidder" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.auctionEnvironment = DEVICE_ORCHESTRATED - imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx - } - - and: "Default bid response with igb config" - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest, OPENX).tap { - ext = new OpenxBidResponseExt().tap { - interestGroupAuctionIntent = [new InterestGroupAuctionIntent( - interestGroupAuctionBuyer: [new InterestGroupAuctionBuyer( - origin: PBSUtils.randomString, - maxBid: PBSUtils.randomDecimal, - cur: PBSUtils.getRandomEnum(Currency), - pbs: [(PBSUtils.randomString): PBSUtils.randomString], - ext: new InterestGroupAuctionBuyerExt( - bidder: PBSUtils.randomString, - adapter: PBSUtils.randomString - ) - )]) - ] - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - when: "PBS processes auction request" - def response = pbsService.sendAuctionRequest(bidRequest) - - then: "PBS response should contain fledge config" - assert !response.ext?.prebid?.fledge?.auctionConfigs - - and: "PBS response shouldn't contain igi config" - assert !response.ext?.interestGroupAuctionIntent - } - - def "PBS should throw error when requested unknown paa format"() { - given: "Default basic BidRequest with ae and openx bidder" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.auctionEnvironment = DEVICE_ORCHESTRATED - imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx - ext.prebid.paaFormat = PaaFormat.INVALID - } - - and: "Default bid response with fledge config" - def impId = bidRequest.imp[0].id - def fledgeConfig = [(PBSUtils.randomString): PBSUtils.randomString] - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest, OPENX).tap { - ext = new OpenxBidResponseExt().tap { - fledgeAuctionConfigs = [(impId): fledgeConfig] - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - when: "PBS processes auction request" - pbsService.sendAuctionRequest(bidRequest) - - then: "Request should fail with error" - def exception = thrown(PrebidServerException) - assert exception.responseBody.startsWith("Invalid request format: Error decoding bidRequest: " + - "Cannot deserialize value of type `org.prebid.server.auction.model.PaaFormat` " + - "from String \"invalid\": not one of the values accepted for Enum class: [original, iab]") - } - - def "PBS shouldn't cause error when igs and igb empty array"() { - given: "Default basic BidRequest with ae and openx bidder" - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.auctionEnvironment = DEVICE_ORCHESTRATED - imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx - ext.prebid.paaFormat = paaFormat - } - - and: "Default bid response with igs config" - def bidResponse = OpenxBidResponse.getDefaultBidResponse(bidRequest, OPENX).tap { - ext = new OpenxBidResponseExt().tap { - interestGroupAuctionIntent = [new InterestGroupAuctionIntent( - interestGroupAuctionSeller: interestGroupAuctionSeller, - interestGroupAuctionBuyer: interestGroupAuctionBuyer - )] - } - } - - and: "Set bidder response" - bidder.setResponse(bidRequest.id, bidResponse) - - when: "PBS processes auction request" - def response = pbsService.sendAuctionRequest(bidRequest) - - then: "PBS response should contain fledge config" - assert !response.ext?.prebid?.fledge?.auctionConfigs - - and: "PBS response shouldn't contain igi config" - assert !response.ext?.interestGroupAuctionIntent - - where: - paaFormat | interestGroupAuctionSeller | interestGroupAuctionBuyer - IAB | [new InterestGroupAuctionSeller()] | [new InterestGroupAuctionBuyer()] - ORIGINAL | [] | [] - } - - def "PBS shouldn't change auction environment in imp.ext.igs and not emit a warning when it is present in both imp.ext and imp.ext.igs"() { - given: "Default bid request with populated imp.ext" - def extAuctionEnv = PBSUtils.getRandomEnum(AuctionEnvironment, [SERVER_ORCHESTRATED, UNKNOWN]) - def extIgsAuctionEnv = PBSUtils.getRandomEnum(AuctionEnvironment, [SERVER_ORCHESTRATED, UNKNOWN]) - def bidRequest = BidRequest.defaultBidRequest.tap { - imp[0].ext.prebid.bidder.openx = Openx.defaultOpenx - imp[0].ext.prebid.bidder.generic = null - imp[0].ext.tap { - auctionEnvironment = extAuctionEnv - interestGroupAuctionSupports = new InterestGroupAuctionSupport(auctionEnvironment: extIgsAuctionEnv) - } - } - - when: "PBS processes auction request" - def bidResponse = pbsService.sendAuctionRequest(bidRequest) - - then: "Bidder request should imp[].{ae/ext.igs.ae} same value as requested" - def bidderRequest = bidder.getBidderRequest(bidRequest.id) - assert bidderRequest.imp[0].ext.auctionEnvironment == extAuctionEnv - assert bidderRequest.imp[0].ext.interestGroupAuctionSupports.auctionEnvironment == extIgsAuctionEnv - - and: "Response shouldn't contain errors" - assert !bidResponse.ext.errors - - and: "Response shouldn't contain warnings" - assert !bidResponse.ext.warnings - } -} From 475999086d9169c6f3dc261b29612f104a7820a2 Mon Sep 17 00:00:00 2001 From: markiian Date: Mon, 1 Dec 2025 19:20:08 +0200 Subject: [PATCH 2/2] Minor update after failed test --- .../org/prebid/server/functional/tests/BidderParamsSpec.groovy | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/test/groovy/org/prebid/server/functional/tests/BidderParamsSpec.groovy b/src/test/groovy/org/prebid/server/functional/tests/BidderParamsSpec.groovy index 4953cb97eb4..3d9b00560fc 100644 --- a/src/test/groovy/org/prebid/server/functional/tests/BidderParamsSpec.groovy +++ b/src/test/groovy/org/prebid/server/functional/tests/BidderParamsSpec.groovy @@ -876,7 +876,6 @@ class BidderParamsSpec extends BaseSpec { prebid.bidder.generic = null prebid.adUnitCode = PBSUtils.randomString generic = new Generic() - auctionEnvironment = PBSUtils.getRandomEnum(AuctionEnvironment, [AuctionEnvironment.SERVER_ORCHESTRATED, AuctionEnvironment.UNKNOWN]) all = PBSUtils.randomNumber context = new ImpExtContext(data: new ImpExtContextData()) data = new ImpExtContextData(pbAdSlot: PBSUtils.randomString) @@ -902,7 +901,6 @@ class BidderParamsSpec extends BaseSpec { def bidderRequest = bidder.getBidderRequest(bidRequest.id) verifyAll(bidderRequest.imp[0].ext) { it.bidder == impExt.generic - it.auctionEnvironment == impExt.auctionEnvironment it.all == impExt.all it.context == impExt.context it.data == impExt.data