Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,19 @@ private List<BidderBid> extractBids(BidResponse bidResponse, List<BidderError> e
.filter(Objects::nonNull)
.flatMap(seatBid -> seatBid.getBid().stream()
.filter(Objects::nonNull)
.map(bid -> makeBid(bid, bidResponse.getCur(), seatBid.getSeat(), errors)))
.map(bid -> makeBid(bid, bidResponse.getCur(), errors)))
.filter(Objects::nonNull)
.toList();
}

private BidderBid makeBid(Bid bid, String currency, String seat, List<BidderError> errors) {
private BidderBid makeBid(Bid bid, String currency, List<BidderError> errors) {
try {
final ExtBidPrebid extBidPrebid = parseBidExt(bid);
return BidderBid.builder()
.bid(bid)
.type(getBidType(bid))
.bidCurrency(currency)
.videoInfo(extBidPrebid != null ? extBidPrebid.getVideo() : null)
.seat(seat)
.build();

} catch (PreBidException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void makeBidsShouldReturnBannerBidWhenMtypeIs1() throws JsonProcessingExc
// then
assertThat(result.getErrors()).isEmpty();
assertThat(result.getValue()).hasSize(1)
.containsExactly(BidderBid.of(bannerBid, BidType.banner, "adagio", "USD"));
.containsExactly(BidderBid.of(bannerBid, BidType.banner, "USD"));
}

@Test
Expand All @@ -154,7 +154,6 @@ public void makeBidsShouldReturnVideoBidWhenMtypeIs2() throws JsonProcessingExce
assertThat(result.getValue()).hasSize(1)
.containsExactly(BidderBid.builder()
.type(BidType.video)
.seat("adagio")
.bidCurrency("USD")
.bid(videoBid)
.videoInfo(ExtBidPrebidVideo.of(10, "cat"))
Expand All @@ -173,7 +172,7 @@ public void makeBidsShouldReturnNativeBidWhenMtypeIs4() throws JsonProcessingExc
// then
assertThat(result.getErrors()).isEmpty();
assertThat(result.getValue()).hasSize(1)
.containsExactly(BidderBid.of(nativeBid, BidType.xNative, "adagio", "USD"));
.containsExactly(BidderBid.of(nativeBid, BidType.xNative, "USD"));
}

@Test
Expand Down Expand Up @@ -232,7 +231,7 @@ private static Bid givenBid(Integer mtype, UnaryOperator<ExtBidPrebid.ExtBidPreb
private static String givenBidResponse(Bid... bids) throws JsonProcessingException {
return mapper.writeValueAsString(BidResponse.builder()
.cur("USD")
.seatbid(singletonList(SeatBid.builder().seat("adagio").bid(List.of(bids)).build()))
.seatbid(singletonList(SeatBid.builder().bid(List.of(bids)).build()))
.build());
}

Expand Down
Loading