diff --git a/src/main/java/org/prebid/server/bidder/between/BetweenBidder.java b/src/main/java/org/prebid/server/bidder/between/BetweenBidder.java index 0d1370e37e9..41535e7f44d 100644 --- a/src/main/java/org/prebid/server/bidder/between/BetweenBidder.java +++ b/src/main/java/org/prebid/server/bidder/between/BetweenBidder.java @@ -27,7 +27,6 @@ import org.prebid.server.proto.openrtb.ext.response.BidType; import org.prebid.server.util.HttpUtil; -import java.math.BigDecimal; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -44,7 +43,6 @@ public class BetweenBidder implements Bidder { new TypeReference>() { }; private static final String URL_HOST_MACRO = "{{Host}}"; - private static final BigDecimal DEFAULT_BID_FLOOR = BigDecimal.valueOf(0.00001); private final String endpointUrl; private final JacksonMapper mapper; @@ -64,7 +62,7 @@ public Result>> makeHttpRequests(BidRequest request try { validateImp(imp); extImpBetween = parseImpExt(imp); - modifiedImps.add(modifyImp(imp, secure, extImpBetween.getBidFloor(), extImpBetween.getBidFloorCur())); + modifiedImps.add(modifyImp(imp, secure)); } catch (PreBidException e) { errors.add(BidderError.badInput(e.getMessage())); } @@ -110,14 +108,12 @@ private ExtImpBetween parseImpExt(Imp imp) { return extImpBetween; } - private static Imp modifyImp(Imp imp, Integer secure, BigDecimal bidFloor, String bidFloorCur) { + private static Imp modifyImp(Imp imp, Integer secure) { final Banner resolvedBanner = resolveBanner(imp.getBanner()); return imp.toBuilder() .banner(resolvedBanner) .secure(secure) - .bidfloor(bidFloor == null || bidFloor.compareTo(BigDecimal.ZERO) <= 0 ? DEFAULT_BID_FLOOR : bidFloor) - .bidfloorcur(StringUtils.isNotBlank(bidFloorCur) ? bidFloorCur : imp.getBidfloorcur()) .build(); } diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/request/between/ExtImpBetween.java b/src/main/java/org/prebid/server/proto/openrtb/ext/request/between/ExtImpBetween.java index 8b70201e053..f951e810006 100644 --- a/src/main/java/org/prebid/server/proto/openrtb/ext/request/between/ExtImpBetween.java +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/request/between/ExtImpBetween.java @@ -3,8 +3,6 @@ import lombok.AllArgsConstructor; import lombok.Value; -import java.math.BigDecimal; - @AllArgsConstructor(staticName = "of") @Value public class ExtImpBetween { @@ -12,8 +10,4 @@ public class ExtImpBetween { String host; String publisherId; - - BigDecimal bidFloor; - - String bidFloorCur; } diff --git a/src/main/resources/static/bidder-params/between.json b/src/main/resources/static/bidder-params/between.json index 032d38fec4b..64863462697 100644 --- a/src/main/resources/static/bidder-params/between.json +++ b/src/main/resources/static/bidder-params/between.json @@ -12,15 +12,6 @@ "publisher_id": { "type": "string", "description": "Publisher ID from Between Exchange control panel" - }, - "bid_floor": { - "type": "number", - "description": "The minimum price acceptable for a bid" - }, - "bid_floor_cur": { - "type": "string", - "description": "Currency of bid floor", - "enum": ["USD", "EUR", "RUB"] } }, "required": ["host", "publisher_id"] diff --git a/src/test/java/org/prebid/server/bidder/between/BetweenBidderTest.java b/src/test/java/org/prebid/server/bidder/between/BetweenBidderTest.java index 79f517acf5d..05edb5cff93 100644 --- a/src/test/java/org/prebid/server/bidder/between/BetweenBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/between/BetweenBidderTest.java @@ -26,7 +26,6 @@ import org.prebid.server.proto.openrtb.ext.request.between.ExtImpBetween; import org.prebid.server.util.HttpUtil; -import java.math.BigDecimal; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -59,11 +58,11 @@ public void creationShouldFailOnInvalidEndpointUrl() { public void makeHttpRequestsShouldReturnErrorIfImpExtContainEmptyOrNullHostParam() { // given final Imp firstImp = givenImp(impBuilder -> impBuilder - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("", "pubId", null, null))))); + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("", "pubId"))))); final Imp secondImp = givenImp(impBuilder -> impBuilder .id("456") - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of(null, "pubId", null, null))))); + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of(null, "pubId"))))); final BidRequest bidRequest = BidRequest.builder() .imp(Arrays.asList(firstImp, secondImp)) @@ -86,11 +85,11 @@ public void makeHttpRequestsShouldReturnErrorIfBannerNotPresentOrSizesNotExists( // given final Imp firstImp = givenImp(impBuilder -> impBuilder .banner(null) - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("host", "pubId", null, null))))); + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("host", "pubId"))))); final Imp secondImp = givenImp(impBuilder -> impBuilder .banner(Banner.builder().build()) - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("host", "pubId", null, null))))); + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("host", "pubId"))))); final BidRequest bidRequest = BidRequest.builder() .imp(Arrays.asList(firstImp, secondImp)) @@ -111,7 +110,7 @@ public void makeHttpRequestsShouldCorrectlyAddHeaders() { // given final Imp firstImp = givenImp(impBuilder -> impBuilder .ext(mapper.valueToTree(ExtPrebid.of(null, - ExtImpBetween.of("host", "pubId", null, null))))); + ExtImpBetween.of("host", "pubId"))))); final BidRequest bidRequest = BidRequest.builder() .device(Device.builder().ua("someUa").dnt(5).ip("someIp").language("someLanguage").build()) @@ -140,11 +139,11 @@ public void makeHttpRequestsShouldCorrectlyAddHeaders() { public void makeHttpRequestsShouldReturnErrorIfImpExtContainEmptyOrNullPublisherIdParam() { // given final Imp firstImp = givenImp(impBuilder -> impBuilder - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("host", "", null, null))))); + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("host", ""))))); final Imp secondImp = givenImp(impBuilder -> impBuilder .id("456") - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("host", null, null, null))))); + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("host", null))))); final BidRequest bidRequest = BidRequest.builder() .imp(Arrays.asList(firstImp, secondImp)) @@ -197,7 +196,7 @@ public void makeHttpRequestsShouldCreateCorrectURL() { } @Test - public void makeHttpRequestsShouldEnrichEveryImpWithSecureBidFlorAndBidFloorCurParams() { + public void makeHttpRequestsShouldEnrichEveryImpWithSecureBidFlor() { // given final BidRequest bidRequest = givenBidRequest(bidRequestBuilder -> bidRequestBuilder .site(Site.builder().page("https://page.com").build()), @@ -213,8 +212,8 @@ public void makeHttpRequestsShouldEnrichEveryImpWithSecureBidFlorAndBidFloorCurP assertThat(result.getValue()).hasSize(1) .extracting(HttpRequest::getPayload) .flatExtracting(BidRequest::getImp) - .extracting(Imp::getSecure, Imp::getBidfloor, Imp::getBidfloorcur) - .containsExactly(tuple(1, BigDecimal.ONE, "EUR")); + .extracting(Imp::getSecure) + .containsExactly(1); } @Test @@ -223,10 +222,7 @@ public void makeHttpRequestsShouldSetDefaultParamsIfAnotherNotPresent() { final BidRequest bidRequest = givenBidRequest(bidRequestBuilder -> bidRequestBuilder .site(Site.builder().page("http://page.com").build()), impBuilder -> impBuilder - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("127.0.0.1", "pubId", - BigDecimal.valueOf(-1), "")))) - .bidfloor(BigDecimal.valueOf(12)) - .bidfloorcur("USD")); + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("127.0.0.1", "pubId"))))); // when final Result>> result = betweenBidder.makeHttpRequests(bidRequest); @@ -236,8 +232,8 @@ public void makeHttpRequestsShouldSetDefaultParamsIfAnotherNotPresent() { assertThat(result.getValue()).hasSize(1) .extracting(HttpRequest::getPayload) .flatExtracting(BidRequest::getImp) - .extracting(Imp::getSecure, Imp::getBidfloor, Imp::getBidfloorcur) - .containsExactly(tuple(0, BigDecimal.valueOf(0.00001), "USD")); + .extracting(Imp::getSecure) + .containsExactly(0); } @Test @@ -357,8 +353,7 @@ private static Imp givenImp(Function impCustomiz return impCustomizer.apply(Imp.builder() .id("123") .banner(Banner.builder().w(23).h(25).build()) - .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("127.0.0.1", "pubId", - BigDecimal.ONE, "EUR"))))) + .ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpBetween.of("127.0.0.1", "pubId"))))) .build(); } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/between/test-auction-between-request.json b/src/test/resources/org/prebid/server/it/openrtb2/between/test-auction-between-request.json index ead08d19038..92fbd7e5fba 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/between/test-auction-between-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/between/test-auction-between-request.json @@ -14,9 +14,7 @@ "ext": { "between": { "host": "lbs-ru1.ads", - "publisher_id": "publisherTestID", - "bid_floor": 12.2345, - "bid_floor_cur": "RUB" + "publisher_id": "publisherTestID" } } } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/between/test-between-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/between/test-between-bid-request.json index e642c53db3c..27bec32f5d7 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/between/test-between-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/between/test-between-bid-request.json @@ -8,15 +8,11 @@ "w": 300, "h": 250 }, - "bidfloor": 12.2345, - "bidfloorcur": "RUB", "secure": 0, "ext": { "bidder": { "host": "lbs-ru1.ads", - "publisher_id": "publisherTestID", - "bid_floor": 12.2345, - "bid_floor_cur": "RUB" + "publisher_id": "publisherTestID" } } }