File tree Expand file tree Collapse file tree
main/java/org/prebid/server/util
test/java/org/prebid/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ public static boolean isValidPrice(Price price) {
6363
6464 public static boolean shouldConvertBidFloor (Price price , String bidderCurrency ) {
6565 return isValidPrice (price )
66- && !StringUtils .equals (price .getCurrency (), bidderCurrency );
66+ && !StringUtils .equalsIgnoreCase (price .getCurrency (), bidderCurrency );
6767 }
6868
6969 public static PriceFloorInfo resolvePriceFloor (Bid bid , BidRequest bidRequest ) {
Original file line number Diff line number Diff line change 1- package org .prebid .server .adtgorg ;
1+ package org .prebid .server .it ;
22
33import io .restassured .response .Response ;
44import org .json .JSONException ;
55import org .junit .jupiter .api .Test ;
6- import org .prebid .server .it .IntegrationTest ;
76import org .prebid .server .model .Endpoint ;
87
98import java .io .IOException ;
Original file line number Diff line number Diff line change 88import com .iab .openrtb .request .Video ;
99import com .iab .openrtb .response .Bid ;
1010import org .junit .jupiter .api .Test ;
11+ import org .prebid .server .bidder .model .Price ;
1112import org .prebid .server .bidder .model .PriceFloorInfo ;
1213import org .prebid .server .proto .openrtb .ext .response .BidType ;
1314
@@ -48,6 +49,18 @@ public void isValidPriceShouldReturnTrueIfPriceIsGreaterThenZero() {
4849 assertThat (BidderUtil .isValidPrice (BigDecimal .ONE )).isTrue ();
4950 }
5051
52+ @ Test
53+ public void shouldConvertBidFloorShouldReturnTrueIfCurrenciesAreDifferent () {
54+ // when and then
55+ assertThat (BidderUtil .shouldConvertBidFloor (Price .of ("USD" , BigDecimal .ONE ), "EUR" )).isTrue ();
56+ }
57+
58+ @ Test
59+ public void shouldConvertBidFloorShouldReturnFalseIfCurrenciesAreSameIgnoringCase () {
60+ // when and then
61+ assertThat (BidderUtil .shouldConvertBidFloor (Price .of ("uSd" , BigDecimal .ONE ), "UsD" )).isFalse ();
62+ }
63+
5164 @ Test
5265 public void resolvePriceFloorShouldReturnNullIfBidIsMissing () {
5366 // when
You can’t perform that action at this time.
0 commit comments