diff --git a/src/main/resources/bidder-config/teqblaze.yaml b/src/main/resources/bidder-config/teqblaze.yaml index 5e1006433ae..734c3d8230c 100644 --- a/src/main/resources/bidder-config/teqblaze.yaml +++ b/src/main/resources/bidder-config/teqblaze.yaml @@ -2,6 +2,19 @@ adapters: teqblaze: endpoint: http:// aliases: + 360playvid: + enabled: false + endpoint: https://ssp.360playvid.com/pserver + meta-info: + maintainer-email: prebid@360playvid.com + usersync: + enabled: true + redirect: + url: https://cookie.360playvid.com/pbserver?gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&coppa={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}}&redir={{redirect_url}} + uid-macro: '[UID]' + iframe: + url: https://cookie.360playvid.com/pbserverIframe?gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&ccpa={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}}&pbserverUrl={{redirect_url}} + uid-macro: '[UID]' pinkLion: enabled: false endpoint: https://us-east-ep.pinklion.io/pserver diff --git a/src/test/java/org/prebid/server/it/ThreeSixtyPlayVidTest.java b/src/test/java/org/prebid/server/it/ThreeSixtyPlayVidTest.java new file mode 100644 index 00000000000..b87be532e46 --- /dev/null +++ b/src/test/java/org/prebid/server/it/ThreeSixtyPlayVidTest.java @@ -0,0 +1,37 @@ +package org.prebid.server.it; + +import io.restassured.response.Response; +import org.json.JSONException; +import org.junit.jupiter.api.Test; +import org.prebid.server.model.Endpoint; + +import java.io.IOException; + +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson; +import static com.github.tomakehurst.wiremock.client.WireMock.post; +import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; +import static java.util.Collections.singletonList; + +public class ThreeSixtyPlayVidTest extends IntegrationTest { + + private static final String BID_REQUEST_JSON = "openrtb2/360playvid/test-360playvid-bid-request.json"; + private static final String BID_RESPONSE_JSON = "openrtb2/360playvid/test-360playvid-bid-response.json"; + private static final String AUCTION_REQUEST_JSON = "openrtb2/360playvid/test-auction-360playvid-request.json"; + private static final String AUCTION_RESPONSE_JSON = "openrtb2/360playvid/test-auction-360playvid-response.json"; + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromThreeSixtyPlayVid() throws IOException, JSONException { + // given + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/360playvid-exchange")) + .withRequestBody(equalToJson(jsonFrom(BID_REQUEST_JSON))) + .willReturn(aResponse().withBody(jsonFrom(BID_RESPONSE_JSON)))); + + // when + final Response response = responseFor(AUCTION_REQUEST_JSON, + Endpoint.openrtb2_auction); + + // then + assertJsonEquals(AUCTION_RESPONSE_JSON, response, singletonList("360playvid")); + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/360playvid/test-360playvid-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/360playvid/test-360playvid-bid-request.json new file mode 100644 index 00000000000..dcf904ba566 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/360playvid/test-360playvid-bid-request.json @@ -0,0 +1,56 @@ +{ + "id": "request_id", + "imp": [ + { + "id": "imp_id", + "banner": { + "w": 300, + "h": 250 + }, + "secure": 1, + "ext": { + "bidder": { + "type": "publisher", + "placementId": "testPlacementId" + } + } + } + ], + "site": { + "domain": "www.example.com", + "page": "http://www.example.com", + "publisher": { + "domain": "example.com" + }, + "ext": { + "amp": 0 + } + }, + "device": { + "ua": "userAgent", + "ip": "193.168.244.1" + }, + "at": 1, + "tmax": "${json-unit.any-number}", + "cur": [ + "USD" + ], + "source": { + "tid": "${json-unit.any-string}" + }, + "regs": { + "ext": { + "gdpr": 0 + } + }, + "ext": { + "prebid": { + "server": { + "externalurl": "http://localhost:8080", + "gvlid": 1, + "datacenter": "local", + "endpoint": "/openrtb2/auction" + } + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/360playvid/test-360playvid-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/360playvid/test-360playvid-bid-response.json new file mode 100644 index 00000000000..180173549d8 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/360playvid/test-360playvid-bid-response.json @@ -0,0 +1,21 @@ +{ + "id": "request_id", + "seatbid": [ + { + "bid": [ + { + "id": "bid_id", + "impid": "imp_id", + "price": 3.33, + "crid": "creativeId", + "mtype": 1, + "ext": { + "prebid": { + "type": "banner" + } + } + } + ] + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/360playvid/test-auction-360playvid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/360playvid/test-auction-360playvid-request.json new file mode 100644 index 00000000000..ed2af3a2166 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/360playvid/test-auction-360playvid-request.json @@ -0,0 +1,23 @@ +{ + "id": "request_id", + "imp": [ + { + "id": "imp_id", + "banner": { + "w": 300, + "h": 250 + }, + "ext": { + "teqblaze": { + "placementId": "testPlacementId" + } + } + } + ], + "tmax": 5000, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/360playvid/test-auction-360playvid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/360playvid/test-auction-360playvid-response.json new file mode 100644 index 00000000000..453b1086633 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/360playvid/test-auction-360playvid-response.json @@ -0,0 +1,38 @@ +{ + "id": "request_id", + "seatbid": [ + { + "bid": [ + { + "id": "bid_id", + "impid": "imp_id", + "exp": 300, + "price": 3.33, + "crid": "creativeId", + "mtype": 1, + "ext": { + "origbidcpm": 3.33, + "prebid": { + "type": "banner", + "meta": { + "adaptercode": "teqblaze" + } + } + } + } + ], + "seat": "teqblaze", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "teqblaze": "{{ teqblaze.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 0 + }, + "tmaxrequest": 5000 + } +}