Skip to content

Commit

Permalink
Update allowed metadata add dchain (#1398)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickluck8 authored Aug 3, 2021
1 parent 02b6666 commit 4826036
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ public class ExtBidPrebidMeta {

@JsonProperty("secondaryCatIds")
List<String> secondaryCatIds;

@JsonProperty("dChain")
String dChain;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2992,6 +2992,31 @@ public void makeBidsShouldReturnBidWithCurrencyFromBidResponse() throws JsonProc
.containsOnly("EUR");
}

@Test
public void makeBidsShouldReturnBidWithDchainFromRequest() throws JsonProcessingException {
// given
final ObjectNode requestNode = mapper.valueToTree(ExtBidPrebid.builder()
.meta(ExtBidPrebidMeta.builder().dChain("dChain").build())
.build());
final HttpCall<BidRequest> httpCall = givenHttpCall(
givenBidRequest(identity()),
mapper.writeValueAsString(RubiconBidResponse.builder()
.seatbid(singletonList(RubiconSeatBid.builder()
.bid(singletonList(givenBid(bid -> bid.ext(requestNode).price(ONE))))
.build()))
.build()));

// when
final Result<List<BidderBid>> result = rubiconBidder.makeBids(httpCall, givenBidRequest(identity()));

// then
assertThat(result.getErrors()).isEmpty();
assertThat(result.getValue())
.extracting(BidderBid::getBid)
.extracting(Bid::getExt)
.containsExactly(requestNode);
}

@Test
public void extractTargetingShouldReturnEmptyMapForEmptyExtension() {
// when and then
Expand Down

0 comments on commit 4826036

Please sign in to comment.