Skip to content

Commit 861bc0d

Browse files
committed
Update after review
1 parent 77a22de commit 861bc0d

2 files changed

Lines changed: 27 additions & 24 deletions

File tree

src/test/groovy/org/prebid/server/functional/model/response/auction/BidRejectionReason.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ enum BidRejectionReason {
2323
RESPONSE_REJECTED_INVALID_CREATIVE(350),
2424
RESPONSE_REJECTED_INVALID_CREATIVE_SIZE(351),
2525
RESPONSE_REJECTED_INVALID_CREATIVE_NOT_SECURE(352),
26-
2726
RESPONSE_REJECTED_DUE_TO_IN_BANNER_VIDEO(353),
28-
2927
RESPONSE_REJECTED_ADVERTISER_BLOCKED(356)
3028

3129
@JsonValue

src/test/groovy/org/prebid/server/functional/tests/module/responsecorrenction/ResponseCorrectionSpec.groovy

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import org.prebid.server.functional.model.config.PbsModulesConfig
99
import org.prebid.server.functional.model.config.SuppressIbv
1010
import org.prebid.server.functional.model.db.Account
1111
import org.prebid.server.functional.model.request.auction.Imp
12-
import org.prebid.server.functional.model.request.auction.Native
1312
import org.prebid.server.functional.model.response.auction.Adm
14-
import org.prebid.server.functional.model.response.auction.Bid
1513
import org.prebid.server.functional.model.response.auction.BidExt
1614
import org.prebid.server.functional.model.response.auction.BidResponse
1715
import org.prebid.server.functional.model.response.auction.Meta
@@ -27,8 +25,7 @@ import static org.prebid.server.functional.model.request.auction.BidRequest.getD
2725
import static org.prebid.server.functional.model.request.auction.DistributionChannel.APP
2826
import static org.prebid.server.functional.model.request.auction.DistributionChannel.DOOH
2927
import static org.prebid.server.functional.model.request.auction.DistributionChannel.SITE
30-
import static org.prebid.server.functional.model.response.auction.BidRejectionReason.*
31-
import static org.prebid.server.functional.model.response.auction.ErrorType.GENERIC
28+
import static org.prebid.server.functional.model.response.auction.BidRejectionReason.RESPONSE_REJECTED_DUE_TO_IN_BANNER_VIDEO
3229
import static org.prebid.server.functional.model.response.auction.MediaType.AUDIO
3330
import static org.prebid.server.functional.model.response.auction.MediaType.BANNER
3431
import static org.prebid.server.functional.model.response.auction.MediaType.NATIVE
@@ -580,7 +577,7 @@ class ResponseCorrectionSpec extends ModuleBaseSpec {
580577
assert !response.ext.warnings
581578
}
582579

583-
def "PBS shouldn't reject auction with 353 code when enabled response correction is #enabledResponseCorrection and enabled suppress ibv is #enabledSuppressIbv"() {
580+
def "PBS should process request without any errors and warning when response correction is #enabledResponseCorrection and suppress ibv is #enabledSuppressIbv"() {
584581
given: "Default bid request with banner and APP"
585582
def bidRequest = getDefaultBidRequest(APP).tap {
586583
ext.prebid.returnAllBidStatus = true
@@ -621,7 +618,7 @@ class ResponseCorrectionSpec extends ModuleBaseSpec {
621618
false | false
622619
}
623620

624-
def "PBS shouldn't reject auction with 353 code when enabled suppress ibv and bid request with imp media type is #mediaType"() {
621+
def "PBS should process request without any errors and warning when suppress ibv is enabled and bid request with imp media type is #mediaType"() {
625622
given: "Default bid request with APP"
626623
def bidRequest = getDefaultBidRequest(APP).tap {
627624
imp[0] = Imp.getDefaultImpression(mediaType)
@@ -660,7 +657,7 @@ class ResponseCorrectionSpec extends ModuleBaseSpec {
660657
mediaType << [VIDEO, NATIVE, AUDIO]
661658
}
662659

663-
def "PBS shouldn't reject auction with 353 code when enabled suppress ibv and bis response with meta media type is #mediaType"() {
660+
def "PBS should process request without any errors and warning when suppress ibv is enabled and bis response with meta media type is #mediaType"() {
664661
given: "Default bid request with banner and APP"
665662
def bidRequest = getDefaultBidRequest(APP).tap {
666663
ext.prebid.returnAllBidStatus = true
@@ -698,16 +695,14 @@ class ResponseCorrectionSpec extends ModuleBaseSpec {
698695
mediaType << [BANNER, NATIVE, AUDIO]
699696
}
700697

701-
def "PBS shouldn't reject auction with 353 code when requested bidder is excluded"() {
698+
def "PBS should process request without any errors and warning when requested bidder is excluded"() {
702699
given: "Default bid request with banner and APP"
703700
def bidRequest = getDefaultBidRequest(APP).tap {
704701
ext.prebid.returnAllBidStatus = true
705702
}
706703

707704
and: "Save account with enabled response correction module and suppress ibv"
708-
def accountWithResponseCorrectionModule = accountConfigWithResponseCorrectionModuleAndSuppressIbv(bidRequest.getAccountId()).tap {
709-
config.hooks.modules.pbResponseCorrection.suppressInBannerVideo.excludedBidders = bidderName
710-
}
705+
def accountWithResponseCorrectionModule = accountConfigWithResponseCorrectionModuleAndSuppressIbv(bidRequest.getAccountId(), bidderName)
711706
accountDao.save(accountWithResponseCorrectionModule)
712707

713708
and: "Set bidder response with meta media type"
@@ -743,16 +738,14 @@ class ResponseCorrectionSpec extends ModuleBaseSpec {
743738
[BidderName.GENERIC, BidderName.GENERIC_CAMEL_CASE],]
744739
}
745740

746-
def "PBS should reject auction with 353 code when enabled suppress ibv and imp with media type Banner and bid response meta media type with Video and excluded bidder are not in case"() {
741+
def "PBS should reject auction with 353 code when suppress IBV is enabled, imp media type is Banner, bid response meta media type is Video, and excluded list lacks request bidder"() {
747742
given: "Default bid request with banner and APP"
748743
def bidRequest = getDefaultBidRequest(APP).tap {
749744
ext.prebid.returnAllBidStatus = true
750745
}
751746

752747
and: "Save account with enabled response correction module and suppress ibv"
753-
def accountWithResponseCorrectionModule = accountConfigWithResponseCorrectionModuleAndSuppressIbv(bidRequest.getAccountId()).tap {
754-
config.hooks.modules.pbResponseCorrection.suppressInBannerVideo.excludedBidders = bidderName
755-
}
748+
def accountWithResponseCorrectionModule = accountConfigWithResponseCorrectionModuleAndSuppressIbv(bidRequest.getAccountId(), bidderName)
756749
accountDao.save(accountWithResponseCorrectionModule)
757750

758751
and: "Set bidder response with meta media type"
@@ -906,19 +899,31 @@ class ResponseCorrectionSpec extends ModuleBaseSpec {
906899
assert response.seatbid.isEmpty()
907900
}
908901

909-
private static Account accountConfigWithResponseCorrectionModuleAndAppVideoHtml(String accountId, boolean enabledResponseCorrection = true, boolean enabledAppVideoHtml = true) {
910-
accountConfigWithResponseCorrectionModule(accountId, enabledResponseCorrection, enabledAppVideoHtml, false)
902+
private static Account accountConfigWithResponseCorrectionModuleAndAppVideoHtml(String accountId) {
903+
accountConfigWithResponseCorrectionModule(accountId, true, true, false, [])
904+
}
905+
906+
private static Account accountConfigWithResponseCorrectionModuleAndAppVideoHtml(String accountId, boolean enabledPbResponseCorrection, boolean enabledAppVideoHtml) {
907+
accountConfigWithResponseCorrectionModule(accountId, enabledPbResponseCorrection, enabledAppVideoHtml, false, [])
908+
}
909+
910+
private static Account accountConfigWithResponseCorrectionModuleAndSuppressIbv(String accountId, List<BidderName> excludeBidders = []) {
911+
accountConfigWithResponseCorrectionModule(accountId, true, false, true, excludeBidders)
911912
}
912913

913-
private static Account accountConfigWithResponseCorrectionModuleAndSuppressIbv(String accountId, boolean enabledResponseCorrection = true, boolean enabledSuppressIbv = true) {
914-
accountConfigWithResponseCorrectionModule(accountId, enabledResponseCorrection, false, enabledSuppressIbv)
914+
private static Account accountConfigWithResponseCorrectionModuleAndSuppressIbv(String accountId, boolean enabledPbResponseCorrection, boolean enabledSuppressIbv) {
915+
accountConfigWithResponseCorrectionModule(accountId, enabledPbResponseCorrection, false, enabledSuppressIbv, [])
915916
}
916917

917-
private static Account accountConfigWithResponseCorrectionModule(String accountId, boolean enabledResponseCorrection, boolean enabledAppVideoHtml = true, boolean enabledSuppressIbv) {
918+
private static Account accountConfigWithResponseCorrectionModule(String accountId,
919+
boolean enabledPbResponseCorrection,
920+
boolean enabledAppVideoHtml,
921+
boolean enabledSuppressIbv,
922+
List<BidderName> excludeBidders) {
918923
def pbResponseCorrection = new PbResponseCorrection().tap {
919-
enabled = enabledResponseCorrection
924+
enabled = enabledPbResponseCorrection
920925
appVideoHtml = new AppVideoHtml(enabled: enabledAppVideoHtml)
921-
suppressInBannerVideo = new SuppressIbv(enabled: enabledSuppressIbv)
926+
suppressInBannerVideo = new SuppressIbv(enabled: enabledSuppressIbv, excludedBidders: excludeBidders)
922927
}
923928
def modulesConfig = new PbsModulesConfig(pbResponseCorrection: pbResponseCorrection)
924929
def accountConfig = new AccountConfig(hooks: new AccountHooksConfiguration(modules: modulesConfig))

0 commit comments

Comments
 (0)