From 84b2b7b978bc1a9c7fda5a1375e6a813b1d30c0d Mon Sep 17 00:00:00 2001 From: nickluck8 Date: Tue, 22 Jun 2021 13:08:25 +0300 Subject: [PATCH 1/3] add new bidder bidmachine --- .../test-cache-bidmachine-request.json | 21 +++++++++++++++++++ .../test-cache-bidmachine-response.json | 7 +++++++ 2 files changed, 28 insertions(+) create mode 100644 src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-request.json create mode 100644 src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-response.json diff --git a/src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-request.json b/src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-request.json new file mode 100644 index 00000000000..424a76e0ac4 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-request.json @@ -0,0 +1,21 @@ +{ + "puts": [ + { + "type": "json", + "value": { + "id": "bid001", + "impid": "impId001", + "price": 3.33, + "adm": "adm001", + "adid": "adid001", + "cid": "cid001", + "crid": "crid001", + "w": 300, + "h": 250, + "ext": { + "origbidcpm": 3.33 + } + } + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-response.json b/src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-response.json new file mode 100644 index 00000000000..93d0b8de2cd --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-response.json @@ -0,0 +1,7 @@ +{ + "responses": [ + { + "uuid": "f0ab9105-cb21-4e59-b433-70f5ad6671cb" + } + ] +} \ No newline at end of file From 4246bec5a32d0eddda67745e9be6f923151337e6 Mon Sep 17 00:00:00 2001 From: nickluck8 Date: Wed, 23 Jun 2021 09:54:49 +0300 Subject: [PATCH 2/3] fix comments --- .../test-cache-bidmachine-request.json | 21 ------------------- .../test-cache-bidmachine-response.json | 7 ------- 2 files changed, 28 deletions(-) delete mode 100644 src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-request.json delete mode 100644 src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-response.json diff --git a/src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-request.json b/src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-request.json deleted file mode 100644 index 424a76e0ac4..00000000000 --- a/src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-request.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "puts": [ - { - "type": "json", - "value": { - "id": "bid001", - "impid": "impId001", - "price": 3.33, - "adm": "adm001", - "adid": "adid001", - "cid": "cid001", - "crid": "crid001", - "w": 300, - "h": 250, - "ext": { - "origbidcpm": 3.33 - } - } - } - ] -} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-response.json b/src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-response.json deleted file mode 100644 index 93d0b8de2cd..00000000000 --- a/src/test/resources/org/prebid/server/it/openrtb2/bidmachine/test-cache-bidmachine-response.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "responses": [ - { - "uuid": "f0ab9105-cb21-4e59-b433-70f5ad6671cb" - } - ] -} \ No newline at end of file From 273749ac3f258c240024364ac7c9ca5c0eaaa55d Mon Sep 17 00:00:00 2001 From: nickluck8 Date: Mon, 2 Aug 2021 14:59:29 +0300 Subject: [PATCH 3/3] add dchain to allowed metadata --- .../ext/response/ExtBidPrebidMeta.java | 3 +++ .../bidder/rubicon/RubiconBidderTest.java | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/main/java/org/prebid/server/proto/openrtb/ext/response/ExtBidPrebidMeta.java b/src/main/java/org/prebid/server/proto/openrtb/ext/response/ExtBidPrebidMeta.java index 282a475d62f..cc980d905d8 100644 --- a/src/main/java/org/prebid/server/proto/openrtb/ext/response/ExtBidPrebidMeta.java +++ b/src/main/java/org/prebid/server/proto/openrtb/ext/response/ExtBidPrebidMeta.java @@ -42,4 +42,7 @@ public class ExtBidPrebidMeta { @JsonProperty("secondaryCatIds") List secondaryCatIds; + + @JsonProperty("dChain") + String dChain; } diff --git a/src/test/java/org/prebid/server/bidder/rubicon/RubiconBidderTest.java b/src/test/java/org/prebid/server/bidder/rubicon/RubiconBidderTest.java index 0d1697e006d..6d4bd65abce 100644 --- a/src/test/java/org/prebid/server/bidder/rubicon/RubiconBidderTest.java +++ b/src/test/java/org/prebid/server/bidder/rubicon/RubiconBidderTest.java @@ -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 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> 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