diff --git a/src/test/java/org/prebid/server/it/OpenxTest.java b/src/test/java/org/prebid/server/it/OpenxTest.java index acbb6015bef..562c70e0cb9 100644 --- a/src/test/java/org/prebid/server/it/OpenxTest.java +++ b/src/test/java/org/prebid/server/it/OpenxTest.java @@ -34,14 +34,14 @@ public void openrtb2AuctionShouldRespondWithBidsFromOpenx() throws IOException, public void openrtb2AuctionWithNativeShouldRespondWithBidsFromOpenx() throws IOException, JSONException { // given WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/openx-exchange")) - .withRequestBody(equalToJson(jsonFrom("openrtb2/openx/test-native-request.json"))) - .willReturn(aResponse().withBody(jsonFrom("openrtb2/openx/test-native-response.json")))); + .withRequestBody(equalToJson(jsonFrom("openrtb2/openx/test-openx-native-request.json"))) + .willReturn(aResponse().withBody(jsonFrom("openrtb2/openx/test-openx-native-response.json")))); // when - final Response response = responseFor("openrtb2/openx/test-native-request.json", + final Response response = responseFor("openrtb2/openx/test-auction-openx-native-request.json", Endpoint.openrtb2_auction); // then - assertJsonEquals("openrtb2/openx/test-native-response.json", response, singletonList("openx")); + assertJsonEquals("openrtb2/openx/test-auction-openx-native-response.json", response, singletonList("openx")); } } diff --git a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-auction-openx-native-request.json b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-auction-openx-native-request.json new file mode 100644 index 00000000000..fd54d6cfd9c --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-auction-openx-native-request.json @@ -0,0 +1,31 @@ +{ + "id": "request_id", + "imp": [ + { + "id": "imp_id", + "native": { + "request": "{\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":25}},{\"id\":2,\"required\":1,\"img\":{\"type\":3,\"wmin\":200,\"hmin\":200}}]}" + }, + "ext": { + "openx": { + "unit": "539439964", + "delDomain": "se-demo-d.openx.net", + "customFloor": "0.5", + "customParams": { + "foo": "bar", + "multifoo": [ + "bar1", + "bar2" + ] + } + } + } + } + ], + "tmax": 5000, + "regs": { + "ext": { + "gdpr": 0 + } + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-auction-openx-native-response.json b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-auction-openx-native-response.json new file mode 100644 index 00000000000..ec05e20c07d --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-auction-openx-native-response.json @@ -0,0 +1,38 @@ +{ + "id": "request_id", + "seatbid": [ + { + "bid": [ + { + "id": "bid_id", + "impid": "imp_id", + "exp": 300, + "price": 5.78, + "adm": "{\"native\":{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"title\":{\"text\":\"Native Ad Title\"}},{\"id\":2,\"img\":{\"url\":\"https://example.com/image.jpg\",\"w\":200,\"h\":200}}],\"link\":{\"url\":\"https://example.com/click\"},\"imptrackers\":[\"https://example.com/impression\"]}}", + "crid": "crid00", + "w": 300, + "h": 250, + "ext": { + "prebid": { + "type": "native" + }, + "origbidcpm": 5.78, + "origbidcur": "USD" + } + } + ], + "seat": "openx", + "group": 0 + } + ], + "cur": "USD", + "ext": { + "responsetimemillis": { + "openx": "{{ openx.response_time_ms }}" + }, + "prebid": { + "auctiontimestamp": 0 + }, + "tmaxrequest": 5000 + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-native-request.json b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-native-request.json deleted file mode 100644 index a019adffee1..00000000000 --- a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-native-request.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "id": "bidRequestId", - "imp": [ - { - "id": "impId1", - "native": { - "request": "{\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":25}},{\"id\":2,\"required\":1,\"img\":{\"type\":3,\"wmin\":200,\"hmin\":200}}]}" - }, - "ext": { - "bidder": { - "customParams": { - "foo": "bar" - }, - "unit": "123456", - "delDomain": "se-demo-d.openx.net" - } - } - } - ], - "user": { - "ext": { - "consent": "consentString" - } - }, - "regs": { - "coppa": 0, - "ext": { - "gdpr": 1 - } - } -} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-native-request.json b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-native-request.json new file mode 100644 index 00000000000..5026b82c24c --- /dev/null +++ b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-native-request.json @@ -0,0 +1,53 @@ +{ + "id": "request_id", + "imp": [ + { + "id": "imp_id", + "secure": 1, + "native": { + "request": "{\"assets\":[{\"id\":1,\"required\":1,\"title\":{\"len\":25}},{\"id\":2,\"required\":1,\"img\":{\"type\":3,\"wmin\":200,\"hmin\":200}}]}" + }, + "tagid": "539439964", + "bidfloor": 0.5, + "ext": { + "customParams": { + "foo": "bar", + "multifoo": [ + "bar1", + "bar2" + ] + }, + "tid" : "${json-unit.any-string}" + } + } + ], + "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": { + "gdpr": 0 + }, + "ext": { + "delDomain": "se-demo-d.openx.net", + "bc": "hb_pbs_1.0.0" + } +} diff --git a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-native-response.json b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-native-response.json similarity index 50% rename from src/test/resources/org/prebid/server/it/openrtb2/openx/test-native-response.json rename to src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-native-response.json index 8292b1504d7..7dea140f71e 100644 --- a/src/test/resources/org/prebid/server/it/openrtb2/openx/test-native-response.json +++ b/src/test/resources/org/prebid/server/it/openrtb2/openx/test-openx-native-response.json @@ -1,23 +1,20 @@ { - "id": "bidRequestId", + "id": "request_id", "seatbid": [ { "bid": [ { - "id": "bidId1", - "impid": "impId1", - "price": 1.5, + "id": "bid_id", + "impid": "imp_id", + "price": 5.78, "adm": "{\"native\":{\"ver\":\"1.2\",\"assets\":[{\"id\":1,\"title\":{\"text\":\"Native Ad Title\"}},{\"id\":2,\"img\":{\"url\":\"https://example.com/image.jpg\",\"w\":200,\"h\":200}}],\"link\":{\"url\":\"https://example.com/click\"},\"imptrackers\":[\"https://example.com/impression\"]}}", - "adomain": ["example.com"], - "iurl": "https://example.com/image.jpg", - "cid": "campaignId1", - "crid": "creativeId1", - "dealid": "dealId1", - "w": 200, - "h": 200 + "crid": "crid00", + "w": 300, + "h": 250 } - ] + ], + "seat": "seatId00", + "group": 0 } - ], - "cur": "USD" + ] }