From 11f0eaa0f8cbaacc925d2dad8ec3134589ae2997 Mon Sep 17 00:00:00 2001 From: Oleksandr Zhevedenko <720803+Net-burst@users.noreply.github.com> Date: Tue, 24 Dec 2024 07:20:00 -0500 Subject: [PATCH] Rubicon: pass imp[].ext.tid (#3648) --- .../org/prebid/server/bidder/rubicon/RubiconBidder.java | 7 +++++++ .../server/bidder/rubicon/proto/request/RubiconImpExt.java | 2 ++ src/test/java/org/prebid/server/it/OwnAdxTest.java | 3 --- .../server/it/hooks/reject/test-rubicon-bid-request-1.json | 3 ++- .../it/hooks/sample-module/test-rubicon-bid-request-1.json | 3 ++- .../it/openrtb2/magnite/test-magnite-bid-request.json | 3 ++- .../it/openrtb2/rubicon/test-rubicon-bid-request.json | 3 ++- 7 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java b/src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java index a420efed87d..ebc7a7dccf4 100644 --- a/src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java +++ b/src/main/java/org/prebid/server/bidder/rubicon/RubiconBidder.java @@ -154,6 +154,7 @@ public class RubiconBidder implements Bidder { private static final String FPD_KEYWORDS_FIELD = "keywords"; private static final String DFP_ADUNIT_CODE_FIELD = "dfp_ad_unit_code"; private static final String STYPE_FIELD = "stype"; + private static final String TID_FIELD = "tid"; private static final String PREBID_EXT = "prebid"; private static final String PBS_LOGIN = "pbs_login"; private static final String PBS_VERSION = "pbs_version"; @@ -700,6 +701,7 @@ private RubiconImpExt makeImpExt(Imp imp, .maxbids(getMaxBids(extRequest)) .gpid(getGpid(imp.getExt())) .skadn(getSkadn(imp.getExt())) + .tid(getTid(imp.getExt())) .prebid(rubiconImpExtPrebid) .build(); } @@ -947,6 +949,11 @@ private ObjectNode getSkadn(ObjectNode impExt) { return skadnNode != null && skadnNode.isObject() ? (ObjectNode) skadnNode : null; } + private String getTid(ObjectNode impExt) { + final JsonNode tidNode = impExt.get(TID_FIELD); + return tidNode != null && tidNode.isTextual() ? tidNode.asText() : null; + } + private String getAdSlot(Imp imp) { final ObjectNode dataNode = toObjectNode(imp.getExt().get(FPD_DATA_FIELD)); diff --git a/src/main/java/org/prebid/server/bidder/rubicon/proto/request/RubiconImpExt.java b/src/main/java/org/prebid/server/bidder/rubicon/proto/request/RubiconImpExt.java index 1c39f9d9345..d40333b891a 100644 --- a/src/main/java/org/prebid/server/bidder/rubicon/proto/request/RubiconImpExt.java +++ b/src/main/java/org/prebid/server/bidder/rubicon/proto/request/RubiconImpExt.java @@ -20,5 +20,7 @@ public class RubiconImpExt { ObjectNode skadn; + String tid; + RubiconImpExtPrebid prebid; } diff --git a/src/test/java/org/prebid/server/it/OwnAdxTest.java b/src/test/java/org/prebid/server/it/OwnAdxTest.java index 1ab4ddb5d71..70c4d6e7686 100644 --- a/src/test/java/org/prebid/server/it/OwnAdxTest.java +++ b/src/test/java/org/prebid/server/it/OwnAdxTest.java @@ -3,9 +3,7 @@ import io.restassured.response.Response; import org.json.JSONException; import org.junit.jupiter.api.Test; -import org.junit.runner.RunWith; import org.prebid.server.model.Endpoint; -import org.springframework.test.context.junit4.SpringRunner; import java.io.IOException; @@ -16,7 +14,6 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; import static java.util.Collections.singletonList; -@RunWith(SpringRunner.class) public class OwnAdxTest extends IntegrationTest { @Test diff --git a/src/test/resources/org/prebid/server/it/hooks/reject/test-rubicon-bid-request-1.json b/src/test/resources/org/prebid/server/it/hooks/reject/test-rubicon-bid-request-1.json index 0daecc354d4..3743bed491b 100644 --- a/src/test/resources/org/prebid/server/it/hooks/reject/test-rubicon-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/hooks/reject/test-rubicon-bid-request-1.json @@ -37,7 +37,8 @@ "mint_version": "" } }, - "maxbids": 1 + "maxbids": 1, + "tid": "${json-unit.any-string}" } } ], diff --git a/src/test/resources/org/prebid/server/it/hooks/sample-module/test-rubicon-bid-request-1.json b/src/test/resources/org/prebid/server/it/hooks/sample-module/test-rubicon-bid-request-1.json index 14d752bc96d..e9a871c9f77 100644 --- a/src/test/resources/org/prebid/server/it/hooks/sample-module/test-rubicon-bid-request-1.json +++ b/src/test/resources/org/prebid/server/it/hooks/sample-module/test-rubicon-bid-request-1.json @@ -38,7 +38,8 @@ "mint_version": "" } }, - "maxbids": 1 + "maxbids": 1, + "tid": "${json-unit.any-string}" } } ], diff --git a/src/test/resources/org/prebid/server/it/openrtb2/magnite/test-magnite-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/magnite/test-magnite-bid-request.json index 08104541960..4b14180a370 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/magnite/test-magnite-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/magnite/test-magnite-bid-request.json @@ -27,7 +27,8 @@ "mint_version": "" } }, - "maxbids": 1 + "maxbids": 1, + "tid": "${json-unit.any-string}" } } ], diff --git a/src/test/resources/org/prebid/server/it/openrtb2/rubicon/test-rubicon-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/rubicon/test-rubicon-bid-request.json index 08104541960..4b14180a370 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/rubicon/test-rubicon-bid-request.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/rubicon/test-rubicon-bid-request.json @@ -27,7 +27,8 @@ "mint_version": "" } }, - "maxbids": 1 + "maxbids": 1, + "tid": "${json-unit.any-string}" } } ],