-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a8129a
commit 56a0ae3
Showing
7 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
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 IndicueTest extends IntegrationTest { | ||
|
||
@Test | ||
public void openrtb2AuctionShouldRespondWithBidsFromIndicue() throws IOException, JSONException { | ||
// given | ||
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/indicue-exchange")) | ||
.withRequestBody(equalToJson(jsonFrom("openrtb2/indicue/test-indicue-bid-request.json"))) | ||
.willReturn(aResponse().withBody( | ||
jsonFrom("openrtb2/indicue/test-indicue-bid-response.json")))); | ||
|
||
// when | ||
final Response response = responseFor("openrtb2/indicue/test-auction-indicue-request.json", | ||
Endpoint.openrtb2_auction); | ||
|
||
// then | ||
assertJsonEquals("openrtb2/indicue/test-auction-indicue-response.json", response, | ||
singletonList("indicue")); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/test/resources/org/prebid/server/it/openrtb2/indicue/test-auction-indicue-request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"id": "request_id", | ||
"imp": [ | ||
{ | ||
"id": "imp_id", | ||
"banner": { | ||
"w": 300, | ||
"h": 250 | ||
}, | ||
"ext": { | ||
"indicue": { | ||
"aid": 1000, | ||
"siteId": 1234, | ||
"bidFloor": 20, | ||
"placementId": 10 | ||
} | ||
} | ||
} | ||
], | ||
"tmax": 5000, | ||
"regs": { | ||
"ext": { | ||
"gdpr": 0 | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/test/resources/org/prebid/server/it/openrtb2/indicue/test-auction-indicue-response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"id": "request_id", | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "bid_id", | ||
"impid": "imp_id", | ||
"price": 8.43, | ||
"adm": "adm14", | ||
"crid": "crid14", | ||
"w": 300, | ||
"h": 250, | ||
"ext": { | ||
"prebid": { | ||
"type": "banner" | ||
}, | ||
"origbidcpm": 8.43 | ||
} | ||
} | ||
], | ||
"seat": "indicue", | ||
"group": 0 | ||
} | ||
], | ||
"cur": "USD", | ||
"ext": { | ||
"responsetimemillis": { | ||
"indicue": "{{ indicue.response_time_ms }}" | ||
}, | ||
"prebid": { | ||
"auctiontimestamp": 0 | ||
}, | ||
"tmaxrequest": 5000 | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
src/test/resources/org/prebid/server/it/openrtb2/indicue/test-indicue-bid-request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"id": "request_id", | ||
"imp": [ | ||
{ | ||
"id": "imp_id", | ||
"secure": 1, | ||
"banner": { | ||
"w": 300, | ||
"h": 250 | ||
}, | ||
"bidfloor": 20, | ||
"ext": { | ||
"adtelligent": { | ||
"aid": 1000, | ||
"placementId": 10, | ||
"siteId": 1234, | ||
"bidFloor": 20 | ||
} | ||
} | ||
} | ||
], | ||
"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" | ||
} | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/test/resources/org/prebid/server/it/openrtb2/indicue/test-indicue-bid-response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"id": "request_id", | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "bid_id", | ||
"impid": "imp_id", | ||
"price": 8.43, | ||
"adm": "adm14", | ||
"crid": "crid14", | ||
"w": 300, | ||
"h": 250 | ||
} | ||
], | ||
"seat": "adtelligent", | ||
"group": 0 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters