diff --git a/src/main/resources/bidder-config/limelightDigital.yaml b/src/main/resources/bidder-config/limelightDigital.yaml index 108d1341485..ab2336287e0 100644 --- a/src/main/resources/bidder-config/limelightDigital.yaml +++ b/src/main/resources/bidder-config/limelightDigital.yaml @@ -31,6 +31,9 @@ adapters: xtrmqb: enabled: false endpoint: http://ads-pbs.ortb.tech/openrtb/{{PublisherID}}?host={{Host}} + embimedia: + enabled: false + endpoint: http://ads-pbs.bidder-embi.media/openrtb/{{PublisherID}}?host={{Host}} meta-info: maintainer-email: engineering@project-limelight.com app-media-types: diff --git a/src/test/java/org/prebid/server/it/EmbimediaTest.java b/src/test/java/org/prebid/server/it/EmbimediaTest.java new file mode 100644 index 00000000000..9d371d8dbec --- /dev/null +++ b/src/test/java/org/prebid/server/it/EmbimediaTest.java @@ -0,0 +1,38 @@ +package org.prebid.server.it; + +import io.restassured.response.Response; +import org.json.JSONException; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.prebid.server.model.Endpoint; +import org.springframework.test.context.junit4.SpringRunner; + +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; + +@RunWith(SpringRunner.class) +public class EmbimediaTest extends IntegrationTest { + + @Test + public void openrtb2AuctionShouldRespondWithBidsFromTheEmbimediaBidder() throws IOException, JSONException { + // given + WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/embimedia-exchange/test.host/123456")) + .withRequestBody(equalToJson( + jsonFrom("openrtb2/embimedia/test-embimedia-bid-request.json"))) + .willReturn(aResponse().withBody( + jsonFrom("openrtb2/embimedia/test-embimedia-bid-response.json")))); + + // when + final Response response = responseFor("openrtb2/embimedia/test-auction-embimedia-request.json", + Endpoint.openrtb2_auction); + + // then + assertJsonEquals("openrtb2/embimedia/test-auction-embimedia-response.json", response, + singletonList("embimedia")); + } +} diff --git a/src/test/java/org/prebid/server/it/XtrmqbGameTest.java b/src/test/java/org/prebid/server/it/XtrmqbTest.java similarity index 96% rename from src/test/java/org/prebid/server/it/XtrmqbGameTest.java rename to src/test/java/org/prebid/server/it/XtrmqbTest.java index 68eab58dbea..9ac73c9c201 100644 --- a/src/test/java/org/prebid/server/it/XtrmqbGameTest.java +++ b/src/test/java/org/prebid/server/it/XtrmqbTest.java @@ -16,7 +16,7 @@ import static java.util.Collections.singletonList; @RunWith(SpringRunner.class) -public class XtrmqbGameTest extends IntegrationTest { +public class XtrmqbTest extends IntegrationTest { @Test public void openrtb2AuctionShouldRespondWithBidsFromTheXtrmqbBidder() throws IOException, JSONException { diff --git a/src/test/resources/org/prebid/server/it/openrtb2/embimedia/test-auction-embimedia-request.json b/src/test/resources/org/prebid/server/it/openrtb2/embimedia/test-auction-embimedia-request.json new file mode 100644 index 00000000000..9ab9a8757c4 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/embimedia/test-auction-embimedia-request.json @@ -0,0 +1,24 @@ +{ + "id": "request_id", + "imp": [ + { + "id": "imp_id", + "banner": { + "w": 300, + "h": 250 + }, + "ext": { + "embimedia": { + "host": "test.host", + "publisherId": "123456" + } + } + } + ], + "tmax": 5000, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/embimedia/test-auction-embimedia-response.json b/src/test/resources/org/prebid/server/it/openrtb2/embimedia/test-auction-embimedia-response.json new file mode 100644 index 00000000000..5de88ba03df --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/embimedia/test-auction-embimedia-response.json @@ -0,0 +1,33 @@ +{ + "id": "request_id", + "seatbid": [ + { + "bid": [ + { + "id": "bid_id", + "impid": "imp_id", + "price": 3.33, + "crid": "creativeId", + "ext": { + "origbidcpm": 3.33, + "prebid": { + "type": "banner" + } + } + } + ], + "seat": "embimedia", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "embimedia": "{{ embimedia.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 0 + }, + "tmaxrequest": 5000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/embimedia/test-embimedia-bid-request.json b/src/test/resources/org/prebid/server/it/openrtb2/embimedia/test-embimedia-bid-request.json new file mode 100644 index 00000000000..8e58e53ba4b --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/embimedia/test-embimedia-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/embimedia/test-embimedia-bid-response.json b/src/test/resources/org/prebid/server/it/openrtb2/embimedia/test-embimedia-bid-response.json new file mode 100644 index 00000000000..04d26e04318 --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/embimedia/test-embimedia-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 4772c3eb9ea..4b34efc2223 100644 --- a/src/test/resources/org/prebid/server/it/test-application.properties +++ b/src/test/resources/org/prebid/server/it/test-application.properties @@ -234,6 +234,8 @@ adapters.limelightDigital.aliases.greedygame.enabled=true adapters.limelightDigital.aliases.greedygame.endpoint=http://localhost:8090/greedygame-exchange/{{Host}}/{{PublisherID}} adapters.limelightDigital.aliases.xtrmqb.enabled=true adapters.limelightDigital.aliases.xtrmqb.endpoint=http://localhost:8090/xtrmqb-exchange/{{Host}}/{{PublisherID}} +adapters.limelightDigital.aliases.embimedia.enabled=true +adapters.limelightDigital.aliases.embimedia.endpoint=http://localhost:8090/embimedia-exchange/{{Host}}/{{PublisherID}} adapters.lockerdome.enabled=true adapters.lockerdome.endpoint=http://localhost:8090/lockerdome-exchange adapters.logan.enabled=true