Skip to content
Merged
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 @@ -596,7 +596,7 @@ private String resolveNativeAdm(String adm, List<BidderError> bidderErrors) {
}

final JsonNode nativeNode = admNode.get("native");
if (!nativeNode.isMissingNode()) {
if (nativeNode != null && !nativeNode.isMissingNode()) {
return nativeNode.toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,28 @@ public void makeBidderResponseShouldReturnFledgeAuctionConfig() throws JsonProce
assertThat(result.getIgi()).containsExactly(igi);
}

@Test
public void makeBidderResponseShouldNotModifyAdmWhenNativeNodeIsNull() throws JsonProcessingException {
// given
final ObjectNode admNode = mapper.createObjectNode().put("otherField", "value");
final BidderCall<BidRequest> httpCall = givenHttpCall(
mapper.writeValueAsString(
givenBidResponse(bidBuilder -> bidBuilder.impid("123")
.adm(admNode.toString())
.ext(mapper.valueToTree(
PubmaticBidExt.of(2, null, 12, null))))));

// when
final CompositeBidderResponse result = target.makeBidderResponse(httpCall, null);

// then
assertThat(result.getErrors()).isEmpty();
assertThat(result.getBids())
.extracting(BidderBid::getBid)
.extracting(Bid::getAdm)
.containsExactly(admNode.toString());
}

@Test
public void makeBidsShouldFail() throws JsonProcessingException {
//given
Expand Down
Loading