Skip to content

Commit 4622c7b

Browse files
committed
add tests
1 parent f4f4eaa commit 4622c7b

5 files changed

Lines changed: 166 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package org.prebid.server.it;
2+
3+
import io.restassured.response.Response;
4+
import org.json.JSONException;
5+
import org.junit.jupiter.api.Test;
6+
import org.prebid.server.model.Endpoint;
7+
8+
import java.io.IOException;
9+
10+
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
11+
import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;
12+
import static com.github.tomakehurst.wiremock.client.WireMock.post;
13+
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
14+
15+
public class 360PlayVidTest extends IntegrationTest {
16+
17+
@Test
18+
public void openrtb2AuctionShouldRespondWithBidsFrom360PlayVid() throws IOException, JSONException {
19+
// given
20+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/360playvid-exchange"))
21+
.withRequestBody(equalToJson(jsonFrom("openrtb2/360playvid/test-360playvid-bid-request.json")))
22+
.willReturn(aResponse().withBody(jsonFrom("openrtb2/360playvid/test-360playvid-bid-response.json"))));
23+
24+
// when
25+
final Response response = responseFor("openrtb2/360playvid/test-auction-360playvid-request.json",
26+
Endpoint.openrtb2_auction);
27+
}
28+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": "request_id",
3+
"imp": [
4+
{
5+
"id": "imp_id",
6+
"banner": {
7+
"w": 300,
8+
"h": 250
9+
},
10+
"ext": {
11+
"teqblaze": {
12+
"placementId": "testPlacementId"
13+
}
14+
}
15+
}
16+
],
17+
"tmax": 5000,
18+
"regs": {
19+
"ext": {
20+
"gdpr": 0
21+
}
22+
}
23+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"exp": 300,
10+
"price": 3.33,
11+
"crid": "creativeId",
12+
"mtype": 1,
13+
"ext": {
14+
"origbidcpm": 3.33,
15+
"prebid": {
16+
"type": "banner",
17+
"meta": {
18+
"adaptercode": "teqblaze"
19+
}
20+
}
21+
}
22+
}
23+
],
24+
"seat": "teqblaze",
25+
"group": 0
26+
}
27+
],
28+
"cur": "USD",
29+
"ext": {
30+
"responsetimemillis": {
31+
"teqblaze": "{{ teqblaze.response_time_ms }}"
32+
},
33+
"prebid": {
34+
"auctiontimestamp": 0
35+
},
36+
"tmaxrequest": 5000
37+
}
38+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"id": "request_id",
3+
"imp": [
4+
{
5+
"id": "imp_id",
6+
"banner": {
7+
"w": 300,
8+
"h": 250
9+
},
10+
"secure": 1,
11+
"ext": {
12+
"bidder": {
13+
"type": "publisher",
14+
"placementId": "testPlacementId"
15+
}
16+
}
17+
}
18+
],
19+
"site": {
20+
"domain": "www.example.com",
21+
"page": "http://www.example.com",
22+
"publisher": {
23+
"domain": "example.com"
24+
},
25+
"ext": {
26+
"amp": 0
27+
}
28+
},
29+
"device": {
30+
"ua": "userAgent",
31+
"ip": "193.168.244.1"
32+
},
33+
"at": 1,
34+
"tmax": "${json-unit.any-number}",
35+
"cur": [
36+
"USD"
37+
],
38+
"source": {
39+
"tid": "${json-unit.any-string}"
40+
},
41+
"regs": {
42+
"ext": {
43+
"gdpr": 0
44+
}
45+
},
46+
"ext": {
47+
"prebid": {
48+
"server": {
49+
"externalurl": "http://localhost:8080",
50+
"gvlid": 1,
51+
"datacenter": "local",
52+
"endpoint": "/openrtb2/auction"
53+
}
54+
}
55+
}
56+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"price": 3.33,
10+
"crid": "creativeId",
11+
"mtype": 1,
12+
"ext": {
13+
"prebid": {
14+
"type": "banner"
15+
}
16+
}
17+
}
18+
]
19+
}
20+
]
21+
}

0 commit comments

Comments
 (0)