diff --git a/src/main/resources/bidder-config/smarthub.yaml b/src/main/resources/bidder-config/smarthub.yaml index 94bb43bc228..c543944c54b 100644 --- a/src/main/resources/bidder-config/smarthub.yaml +++ b/src/main/resources/bidder-config/smarthub.yaml @@ -17,6 +17,9 @@ adapters: felixads: enabled: false endpoint: https://felixads-prebid.attekmi.com/pbserver/?seat={{AccountID}}&token={{SourceId}} + adinify: + enabled: false + endpoint: https://adinify-prebid.attekmi.com/pbserver/?seat={{AccountID}}&token={{SourceId}} artechnology: enabled: false endpoint: https://artechnology-prebid.attekmi.com/pbserver/?seat={{AccountID}}&token={{SourceId}} diff --git a/src/test/java/org/prebid/server/it/AdinifyTest.java b/src/test/java/org/prebid/server/it/AdinifyTest.java new file mode 100644 index 00000000000..2b0234373b7 --- /dev/null +++ b/src/test/java/org/prebid/server/it/AdinifyTest.java @@ -0,0 +1,36 @@ +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.equalTo; +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 AdinifyTest extends IntegrationTest { + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromAdinify() throws IOException, JSONException { + // given + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/adinify-exchange")) + .withQueryParam("host", equalTo("someUniquePartnerName")) + .withQueryParam("accountId", equalTo("someSeat")) + .withQueryParam("sourceId", equalTo("someToken")) + .withRequestBody(equalToJson(jsonFrom("openrtb2/adinify/test-adinify-bid-request.json"))) + .willReturn(aResponse().withBody(jsonFrom("openrtb2/adinify/test-adinify-bid-response.json")))); + + // when + final Response response = responseFor("openrtb2/adinify/test-auction-adinify-request.json", + Endpoint.openrtb2_auction); + + // then + assertJsonEquals("openrtb2/adinify/test-auction-adinify-response.json", response, singletonList("adinify")); + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/adinify/test-adinify-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/adinify/test-adinify-bid-request.json new file mode 100644 index 00000000000..9342b97a4fa --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/adinify/test-adinify-bid-request.json @@ -0,0 +1,58 @@ +{ + "id": "request_id", + "imp": [ + { + "id": "imp_id", + "secure": 1, + "banner": { + "w": 300, + "h": 250 + }, + "ext": { + "tid": "${json-unit.any-string}", + "bidder": { + "partnerName": "someUniquePartnerName", + "seat": "someSeat", + "token": "someToken" + } + } + } + ], + "source": { + "tid": "${json-unit.any-string}" + }, + "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" + ], + "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/adinify/test-adinify-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/adinify/test-adinify-bid-response.json new file mode 100644 index 00000000000..ecfbbed0ded --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/adinify/test-adinify-bid-response.json @@ -0,0 +1,23 @@ +{ + "id": "request_id", + "seatbid": [ + { + "bid": [ + { + "id": "bid_id", + "impid": "imp_id", + "price": 3.33, + "adid": "adid001", + "crid": "crid001", + "cid": "cid001", + "adm": "adm001", + "h": 250, + "w": 300, + "ext": { + "mediaType": "video" + } + } + ] + } + ] +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/adinify/test-auction-adinify-request.json b/src/test/resources/org/prebid/server/it/openrtb2/adinify/test-auction-adinify-request.json new file mode 100644 index 00000000000..dd48a736b4c --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/adinify/test-auction-adinify-request.json @@ -0,0 +1,25 @@ +{ + "id": "request_id", + "imp": [ + { + "id": "imp_id", + "banner": { + "w": 300, + "h": 250 + }, + "ext": { + "adinify": { + "partnerName": "someUniquePartnerName", + "seat": "someSeat", + "token": "someToken" + } + } + } + ], + "tmax": 5000, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/adinify/test-auction-adinify-response.json b/src/test/resources/org/prebid/server/it/openrtb2/adinify/test-auction-adinify-response.json new file mode 100644 index 00000000000..c1163d30d8c --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/adinify/test-auction-adinify-response.json @@ -0,0 +1,40 @@ +{ + "id": "request_id", + "seatbid": [ + { + "bid": [ + { + "id": "bid_id", + "impid": "imp_id", + "exp": 1500, + "price": 3.33, + "adm": "adm001", + "adid": "adid001", + "cid": "cid001", + "crid": "crid001", + "w": 300, + "h": 250, + "ext": { + "mediaType": "video", + "origbidcpm": 3.33, + "prebid": { + "type": "video" + } + } + } + ], + "seat": "adinify", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "adinify": "{{ adinify.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 0 + }, + "tmaxrequest": 5000 + } +} diff --git a/src/test/resources/org/prebid/server/it/test-application.properties b/src/test/resources/org/prebid/server/it/test-application.properties index 3a413d236cc..2a3d1dfab99 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -427,6 +427,8 @@ adapters.smarthub.aliases.vimayx.enabled=true adapters.smarthub.aliases.vimayx.endpoint=http://localhost:8090/vimayx-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}} adapters.smarthub.aliases.felixads.enabled=true adapters.smarthub.aliases.felixads.endpoint=http://localhost:8090/felixads-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}} +adapters.smarthub.aliases.adinify.enabled=true +adapters.smarthub.aliases.adinify.endpoint=http://localhost:8090/adinify-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}} adapters.smarthub.aliases.artechnology.enabled=true adapters.smarthub.aliases.artechnology.endpoint=http://localhost:8090/artechnology-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}} adapters.smartyads.enabled=true