diff --git a/src/main/resources/bidder-config/limelightDigital.yaml b/src/main/resources/bidder-config/limelightDigital.yaml index cace3054779..961d909e0d0 100644 --- a/src/main/resources/bidder-config/limelightDigital.yaml +++ b/src/main/resources/bidder-config/limelightDigital.yaml @@ -55,6 +55,9 @@ adapters: adtg_org: enabled: false endpoint: http://ads-pbs.rtb.adtarget.org/openrtb/{{PublisherID}}?host={{Host}} + performist: + enabled: false + endpoint: http://ads-pbs.performserv.com/openrtb/{{PublisherID}} meta-info: maintainer-email: engineering@project-limelight.com app-media-types: diff --git a/src/test/java/org/prebid/server/it/PerformistTest.java b/src/test/java/org/prebid/server/it/PerformistTest.java new file mode 100644 index 00000000000..56c9586e4a3 --- /dev/null +++ b/src/test/java/org/prebid/server/it/PerformistTest.java @@ -0,0 +1,35 @@ +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 PerformistTest extends IntegrationTest { + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromThePerformistBidder() throws IOException, JSONException { + // given + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/performist-exchange/")) + .withRequestBody(equalToJson( + jsonFrom("openrtb2/performist/test-performist-bid-request.json"))) + .willReturn(aResponse().withBody( + jsonFrom("openrtb2/performist/test-performist-bid-response.json")))); + + // when + final Response response = responseFor("openrtb2/performist/test-auction-performist-request.json", + Endpoint.openrtb2_auction); + + // then + assertJsonEquals("openrtb2/performist/test-auction-performist-response.json", response, + singletonList("performist")); + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/performist/test-auction-performist-request.json b/src/test/resources/org/prebid/server/it/openrtb2/performist/test-auction-performist-request.json new file mode 100644 index 00000000000..61b85c30300 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/performist/test-auction-performist-request.json @@ -0,0 +1,24 @@ +{ + "id": "request_id", + "imp": [ + { + "id": "imp_id", + "banner": { + "w": 300, + "h": 250 + }, + "ext": { + "performist": { + "host": "test.host", + "publisherId": "123456" + } + } + } + ], + "tmax": 5000, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/performist/test-auction-performist-response.json b/src/test/resources/org/prebid/server/it/openrtb2/performist/test-auction-performist-response.json new file mode 100644 index 00000000000..0644af56efe --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/performist/test-auction-performist-response.json @@ -0,0 +1,37 @@ +{ + "id": "request_id", + "seatbid": [ + { + "bid": [ + { + "id": "bid_id", + "impid": "imp_id", + "exp": 300, + "price": 3.33, + "crid": "creativeId", + "ext": { + "origbidcpm": 3.33, + "prebid": { + "type": "banner", + "meta": { + "adaptercode": "performist" + } + } + } + } + ], + "seat": "performist", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "performist": "{{ performist.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 0 + }, + "tmaxrequest": 5000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/performist/test-performist-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/performist/test-performist-bid-request.json new file mode 100644 index 00000000000..8e58e53ba4b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/performist/test-performist-bid-request.json @@ -0,0 +1,40 @@ +{ + "id": "request_id-imp_id", + "imp": [ + { + "id": "imp_id", + "secure": 1, + "banner": { + "w": 300, + "h": 250 + } + } + ], + "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 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/performist/test-performist-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/performist/test-performist-bid-response.json new file mode 100644 index 00000000000..04d26e04318 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/performist/test-performist-bid-response.json @@ -0,0 +1,15 @@ +{ + "id": "request_id", + "seatbid": [ + { + "bid": [ + { + "id": "bid_id", + "impid": "imp_id", + "price": 3.33, + "crid": "creativeId" + } + ] + } + ] +} 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 c2e136cf572..778536d9cb3 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -353,6 +353,8 @@ adapters.limelightDigital.aliases.velonium.enabled=true adapters.limelightDigital.aliases.velonium.endpoint=http://localhost:8090/velonium-exchange/ adapters.limelightDigital.aliases.adtg_org.enabled=true adapters.limelightDigital.aliases.adtg_org.endpoint=http://localhost:8090/adtg_org-exchange/ +adapters.limelightDigital.aliases.performist.enabled=true +adapters.limelightDigital.aliases.performist.endpoint=http://localhost:8090/performist-exchange/ adapters.lmkiviads.enabled=true adapters.lmkiviads.endpoint=http://localhost:8090/lm-kiviads-exchange/{{SourceId}}/{{Host}} adapters.lockerdome.enabled=true