diff --git a/src/main/java/org/prebid/server/bidder/displayio/DisplayioBidder.java b/src/main/java/org/prebid/server/bidder/displayio/DisplayioBidder.java index b0207293e4d..fe0e8ad6a03 100644 --- a/src/main/java/org/prebid/server/bidder/displayio/DisplayioBidder.java +++ b/src/main/java/org/prebid/server/bidder/displayio/DisplayioBidder.java @@ -102,11 +102,8 @@ private BigDecimal resolveBidFloor(BidRequest bidRequest, Imp imp) { final BigDecimal bidFloor = imp.getBidfloor(); final String bidFloorCurrency = imp.getBidfloorcur(); - if (!BidderUtil.isValidPrice(bidFloor)) { - throw new PreBidException("BidFloor should be defined"); - } - - if (StringUtils.isNotBlank(bidFloorCurrency) + if (BidderUtil.isValidPrice(bidFloor) + && StringUtils.isNotBlank(bidFloorCurrency) && !StringUtils.equalsIgnoreCase(bidFloorCurrency, BIDDER_CURRENCY)) { return currencyConversionService.convertCurrency(bidFloor, bidRequest, bidFloorCurrency, BIDDER_CURRENCY); } diff --git a/src/test/java/org/prebid/server/bidder/displayio/DisplayioBidderTest.java b/src/test/java/org/prebid/server/bidder/displayio/DisplayioBidderTest.java index a88bf18e406..fe403f14fb9 100644 --- a/src/test/java/org/prebid/server/bidder/displayio/DisplayioBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/displayio/DisplayioBidderTest.java @@ -88,16 +88,22 @@ public void makeHttpRequestsShouldReturnErrorIfImpExtCouldNotBeParsed() { } @Test - public void makeHttpRequestsShouldReturnErrorWhenBidFloorIsMissing() { + public void makeHttpRequestsShouldSetDefaultCurrencyEvenWhenBidfloorIsAbsent() { // given - final BidRequest bidRequest = givenBidRequest(imp -> imp.bidfloor(null)); + final BidRequest bidRequest = givenBidRequest(imp -> imp.bidfloor(null).bidfloorcur("EUR")); // when final Result>> result = target.makeHttpRequests(bidRequest); // then - assertThat(result.getValue()).isEmpty(); - assertThat(result.getErrors()).containsOnly(BidderError.badInput("BidFloor should be defined")); + assertThat(result.getErrors()).isEmpty(); + assertThat(result.getValue()) + .extracting(HttpRequest::getPayload) + .flatExtracting(BidRequest::getImp) + .extracting(Imp::getBidfloor, Imp::getBidfloorcur) + .containsOnly(tuple(null, "USD")); + + verifyNoInteractions(currencyConversionService); } @Test @@ -156,8 +162,7 @@ public void shouldMakeOneRequestWhenOneImpIsValidAndAnotherAreInvalid() { // given final BidRequest bidRequest = givenBidRequest( imp -> imp.id("impId1").ext(mapper.valueToTree(ExtPrebid.of(null, mapper.createArrayNode()))), - imp -> imp.id("impId2").bidfloor(null), - imp -> imp.id("impId3")); + imp -> imp.id("impId2")); //when final Result>> result = target.makeHttpRequests(bidRequest); @@ -167,7 +172,7 @@ public void shouldMakeOneRequestWhenOneImpIsValidAndAnotherAreInvalid() { .extracting(HttpRequest::getPayload) .flatExtracting(BidRequest::getImp) .extracting(Imp::getId) - .containsExactly("impId3"); + .containsExactly("impId2"); } @Test