diff --git a/src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java b/src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java index 675d5dd4bd5..dd54fc864d8 100644 --- a/src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java +++ b/src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java @@ -188,7 +188,6 @@ public class RubiconBidder implements Bidder { private final String xapiUsername; private final Set supportedVendors; private final boolean generateBidId; - private final boolean useVideoSizeLogic; private final CurrencyConversionService currencyConversionService; private final PriceFloorResolver floorResolver; private final PrebidVersionProvider versionProvider; @@ -203,7 +202,6 @@ public RubiconBidder(String bidderName, String xapiPassword, List supportedVendors, boolean generateBidId, - boolean useVideoSizeLogic, CurrencyConversionService currencyConversionService, PriceFloorResolver floorResolver, PrebidVersionProvider versionProvider, @@ -215,7 +213,6 @@ public RubiconBidder(String bidderName, this.xapiUsername = Objects.requireNonNull(xapiUsername); this.supportedVendors = Set.copyOf(Objects.requireNonNull(supportedVendors)); this.generateBidId = generateBidId; - this.useVideoSizeLogic = useVideoSizeLogic; this.currencyConversionService = Objects.requireNonNull(currencyConversionService); this.floorResolver = Objects.requireNonNull(floorResolver); this.versionProvider = Objects.requireNonNull(versionProvider); @@ -1027,9 +1024,8 @@ private Video makeVideo(Imp imp, RubiconVideoParams rubiconVideoParams, String r private Integer resolveSizeId(RubiconVideoParams rubiconVideoParams, Imp imp, String referer) { final Integer sizeId = rubiconVideoParams != null ? rubiconVideoParams.getSizeId() : null; - final Video video = imp.getVideo(); final Integer resolvedSizeId = BidderUtil.isNullOrZero(sizeId) - ? useVideoSizeLogic ? resolveVideoSizeId(video.getPlacement(), imp.getInstl()) : null + ? null : sizeId; validateVideoSizeId(resolvedSizeId, referer, imp.getId()); @@ -1046,23 +1042,6 @@ private static void validateVideoSizeId(Integer resolvedSizeId, String referer, } } - private static Integer resolveVideoSizeId(Integer placement, Integer instl) { - if (placement != null) { - if (placement == 1) { - return 201; - } - if (placement == 3) { - return 203; - } - } - - if (instl != null && instl == 1) { - return 202; - } - - return null; - } - private Banner makeBanner(Imp imp) { final Banner banner = imp.getBanner(); final Integer width = banner.getW(); diff --git a/src/main/java/org/prebid/server/spring/config/bidder/RubiconConfiguration.java b/src/main/java/org/prebid/server/spring/config/bidder/RubiconConfiguration.java index d78f5324c01..89f80e439aa 100644 --- a/src/main/java/org/prebid/server/spring/config/bidder/RubiconConfiguration.java +++ b/src/main/java/org/prebid/server/spring/config/bidder/RubiconConfiguration.java @@ -56,7 +56,6 @@ BidderDeps rubiconBidderDeps(RubiconConfigurationProperties rubiconConfiguration config.getXapi().getPassword(), config.getMetaInfo().getSupportedVendors(), config.getGenerateBidId(), - config.getUseVideoSizeIdLogic(), currencyConversionService, floorResolver, versionProvider, @@ -76,9 +75,6 @@ private static class RubiconConfigurationProperties extends BidderConfigurationP @NotNull private Boolean generateBidId; - - @NotNull - private Boolean useVideoSizeIdLogic; } @Data diff --git a/src/test/java/org/prebid/server/bidder/rubicon/RubiconBidderTest.java b/src/test/java/org/prebid/server/bidder/rubicon/RubiconBidderTest.java index b7c2a053298..47a0694ef93 100644 --- a/src/test/java/org/prebid/server/bidder/rubicon/RubiconBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/rubicon/RubiconBidderTest.java @@ -176,7 +176,6 @@ public void setUp() { PASSWORD, SUPPORTED_VENDORS, false, - true, currencyConversionService, priceFloorResolver, versionProvider, @@ -195,7 +194,6 @@ public void creationShouldFailOnInvalidEndpointUrl() { PASSWORD, SUPPORTED_VENDORS, false, - true, currencyConversionService, priceFloorResolver, versionProvider, @@ -865,7 +863,7 @@ public void makeHttpRequestsShouldIgnoreBidRequestIfCurrencyServiceThrowsAnExcep } @Test - public void shouldNotSetSizeIfVideoSizeProcessingLogicIsDisabledAndBidderParamsIsMissingSizeId() { + public void shouldNotSetSizeIfBidderParamsIsMissingSizeId() { // given target = new RubiconBidder( BIDDER_NAME, @@ -875,7 +873,6 @@ public void shouldNotSetSizeIfVideoSizeProcessingLogicIsDisabledAndBidderParamsI PASSWORD, SUPPORTED_VENDORS, true, - false, currencyConversionService, priceFloorResolver, versionProvider, @@ -897,111 +894,6 @@ public void shouldNotSetSizeIfVideoSizeProcessingLogicIsDisabledAndBidderParamsI .containsOnlyNulls(); } - @Test - public void shouldSetSizeFromBidderParamsWhenVideoSizeProcessingLogicIsDisabled() { - // given - target = new RubiconBidder( - BIDDER_NAME, - ENDPOINT_URL, - EXTERNAL_URL, - USERNAME, - PASSWORD, - SUPPORTED_VENDORS, - true, - false, - currencyConversionService, - priceFloorResolver, - versionProvider, - jacksonMapper); - final BidRequest bidRequest = givenBidRequest( - builder -> builder.instl(1).video(Video.builder().placement(1).build()), - builder -> builder.video(RubiconVideoParams.builder().sizeId(14).build())); - - // when - final Result>> result = target.makeHttpRequests(bidRequest); - - // then - assertThat(result.getErrors()).isEmpty(); - assertThat(result.getValue()).hasSize(1).doesNotContainNull() - .extracting(httpRequest -> mapper.readValue(httpRequest.getBody(), BidRequest.class)) - .flatExtracting(BidRequest::getImp) - .extracting(Imp::getVideo).doesNotContainNull() - .extracting(Video::getExt).doesNotContainNull() - .extracting(ext -> mapper.treeToValue(ext, RubiconVideoExt.class)) - .extracting(RubiconVideoExt::getRp) - .extracting(RubiconVideoExtRp::getSizeId) - .containsOnly(14); - } - - @Test - public void shouldSetSizeIdTo201IfPlacementIs1AndSizeIdIsNotPresent() { - // given - final BidRequest bidRequest = givenBidRequest( - builder -> builder.instl(1).video(Video.builder().placement(1).build()), - builder -> builder.video(RubiconVideoParams.builder().sizeId(null).build())); - - // when - final Result>> result = target.makeHttpRequests(bidRequest); - - // then - assertThat(result.getErrors()).isEmpty(); - assertThat(result.getValue()).hasSize(1).doesNotContainNull() - .extracting(httpRequest -> mapper.readValue(httpRequest.getBody(), BidRequest.class)) - .flatExtracting(BidRequest::getImp) - .extracting(Imp::getVideo).doesNotContainNull() - .extracting(Video::getExt).doesNotContainNull() - .extracting(ext -> mapper.treeToValue(ext, RubiconVideoExt.class)) - .extracting(RubiconVideoExt::getRp) - .extracting(RubiconVideoExtRp::getSizeId) - .containsOnly(201); - } - - @Test - public void shouldSetSizeIdTo203IfPlacementIs3AndSizeIdIsNotPresent() { - // given - final BidRequest bidRequest = givenBidRequest( - builder -> builder.instl(1).video(Video.builder().placement(3).build()), - builder -> builder.video(RubiconVideoParams.builder().sizeId(null).build())); - - // when - final Result>> result = target.makeHttpRequests(bidRequest); - - // then - assertThat(result.getErrors()).isEmpty(); - assertThat(result.getValue()).hasSize(1).doesNotContainNull() - .extracting(httpRequest -> mapper.readValue(httpRequest.getBody(), BidRequest.class)) - .flatExtracting(BidRequest::getImp) - .extracting(Imp::getVideo).doesNotContainNull() - .extracting(Video::getExt).doesNotContainNull() - .extracting(ext -> mapper.treeToValue(ext, RubiconVideoExt.class)) - .extracting(RubiconVideoExt::getRp) - .extracting(RubiconVideoExtRp::getSizeId) - .containsOnly(203); - } - - @Test - public void shouldSetSizeIdTo202UsingInstlFlagIfPlacementAndSizeIdAreNotPresent() { - // given - final BidRequest bidRequest = givenBidRequest( - builder -> builder.instl(1).video(Video.builder().placement(null).build()), - builder -> builder.video(RubiconVideoParams.builder().sizeId(null).build())); - - // when - final Result>> result = target.makeHttpRequests(bidRequest); - - // then - assertThat(result.getErrors()).isEmpty(); - assertThat(result.getValue()).hasSize(1).doesNotContainNull() - .extracting(httpRequest -> mapper.readValue(httpRequest.getBody(), BidRequest.class)) - .flatExtracting(BidRequest::getImp) - .extracting(Imp::getVideo).doesNotContainNull() - .extracting(Video::getExt).doesNotContainNull() - .extracting(ext -> mapper.treeToValue(ext, RubiconVideoExt.class)) - .extracting(RubiconVideoExt::getRp) - .extracting(RubiconVideoExtRp::getSizeId) - .containsOnly(202); - } - @Test public void makeHttpRequestsShouldFillVideoExt() { // given @@ -3785,7 +3677,7 @@ public void makeBidsShouldReturnNativeBidIfNativeIsPresent() throws JsonProcessi public void makeBidsShouldReturnBidWithRandomlyGeneratedId() throws JsonProcessingException { // given target = new RubiconBidder( - BIDDER_NAME, ENDPOINT_URL, ENDPOINT_URL, USERNAME, PASSWORD, SUPPORTED_VENDORS, true, true, + BIDDER_NAME, ENDPOINT_URL, ENDPOINT_URL, USERNAME, PASSWORD, SUPPORTED_VENDORS, true, currencyConversionService, priceFloorResolver, versionProvider, jacksonMapper); final BidderCall httpCall = givenHttpCall(givenBidRequest(identity()), @@ -3811,7 +3703,7 @@ public void makeBidsShouldReturnBidWithRandomlyGeneratedId() throws JsonProcessi public void makeBidsShouldReturnBidWithCurrencyFromBidResponse() throws JsonProcessingException { // given target = new RubiconBidder( - BIDDER_NAME, ENDPOINT_URL, EXTERNAL_URL, USERNAME, PASSWORD, SUPPORTED_VENDORS, true, true, + BIDDER_NAME, ENDPOINT_URL, EXTERNAL_URL, USERNAME, PASSWORD, SUPPORTED_VENDORS, true, currencyConversionService, priceFloorResolver, versionProvider, jacksonMapper); final BidderCall httpCall = givenHttpCall(givenBidRequest(identity()),