Skip to content

Commit 1f49d7f

Browse files
Blue: Add placementId bidder param prebid#3609 (prebid#3733)
1 parent a52f2df commit 1f49d7f

File tree

7 files changed

+193
-0
lines changed

7 files changed

+193
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "Blue Adapter Params",
4+
"description": "A schema which validates params accepted by the Blue adapter",
5+
"type": "object",
6+
"properties": {
7+
"placementId": {
8+
"type": "string",
9+
"description": "Placement ID provided by Blue"
10+
},
11+
"publisherId": {
12+
"type": "string",
13+
"description": "The publisher’s ID provided by Blue"
14+
}
15+
},
16+
"required": [
17+
"publisherId"
18+
]
19+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
import static java.util.Collections.singletonList;
15+
16+
public class BlueTest extends IntegrationTest {
17+
18+
@Test
19+
public void openrtb2AuctionShouldRespondWithBidsFromBlue() throws IOException, JSONException {
20+
// given
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/blue-exchange"))
22+
.withRequestBody(equalToJson(jsonFrom("openrtb2/blue/test-blue-bid-request.json")))
23+
.willReturn(aResponse().withBody(jsonFrom("openrtb2/blue/test-blue-bid-response.json"))));
24+
25+
// when
26+
final Response response =
27+
responseFor("openrtb2/blue/test-auction-blue-request.json", Endpoint.openrtb2_auction);
28+
29+
// then
30+
assertJsonEquals("openrtb2/blue/test-auction-blue-response.json", response, singletonList("blue"));
31+
}
32+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"id": "request_id",
3+
"imp": [
4+
{
5+
"id": "imp_id",
6+
"banner": {
7+
"w": 300,
8+
"h": 250
9+
},
10+
"ext": {
11+
"blue": {
12+
"publisherId": "testPublisherId",
13+
"placementId": "testPlacementId"
14+
}
15+
}
16+
}
17+
],
18+
"tmax": 5000,
19+
"regs": {
20+
"ext": {
21+
"gdpr": 0
22+
}
23+
}
24+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
"adm": "adm001",
12+
"adid": "adid001",
13+
"cid": "cid001",
14+
"crid": "crid001",
15+
"w": 300,
16+
"h": 250,
17+
"ext": {
18+
"prebid": {
19+
"type": "banner"
20+
},
21+
"origbidcpm": 3.33
22+
}
23+
}
24+
],
25+
"seat": "blue",
26+
"group": 0
27+
}
28+
],
29+
"cur": "USD",
30+
"ext": {
31+
"responsetimemillis": {
32+
"blue": 0
33+
},
34+
"prebid": {
35+
"auctiontimestamp": 0
36+
},
37+
"tmaxrequest": 5000
38+
}
39+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
"tid": "${json-unit.any-string}",
13+
"bidder": {
14+
"publisherId": "testPublisherId",
15+
"placementId": "testPlacementId"
16+
}
17+
}
18+
}
19+
],
20+
"source": {
21+
"tid": "${json-unit.any-string}"
22+
},
23+
"site": {
24+
"domain": "www.example.com",
25+
"page": "http://www.example.com",
26+
"publisher": {
27+
"domain": "example.com"
28+
},
29+
"ext": {
30+
"amp": 0
31+
}
32+
},
33+
"device": {
34+
"ua": "userAgent",
35+
"ip": "193.168.244.1"
36+
},
37+
"at": 1,
38+
"tmax": "${json-unit.any-number}",
39+
"cur": [
40+
"USD"
41+
],
42+
"regs": {
43+
"ext": {
44+
"gdpr": 0
45+
}
46+
},
47+
"ext": {
48+
"prebid": {
49+
"server": {
50+
"externalurl": "http://localhost:8080",
51+
"gvlid": 1,
52+
"datacenter": "local",
53+
"endpoint": "/openrtb2/auction"
54+
}
55+
}
56+
}
57+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"price": 3.33,
10+
"adid": "adid001",
11+
"crid": "crid001",
12+
"cid": "cid001",
13+
"adm": "adm001",
14+
"h": 250,
15+
"w": 300
16+
}
17+
]
18+
}
19+
]
20+
}

src/test/resources/org/prebid/server/it/test-application.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ adapters.generic.aliases.nativo.enabled=true
66
adapters.generic.aliases.nativo.endpoint=http://localhost:8090/nativo-exchange
77
adapters.generic.aliases.adrino.enabled=true
88
adapters.generic.aliases.adrino.endpoint=http://localhost:8090/adrino-exchange
9+
adapters.generic.aliases.blue.enabled=true
10+
adapters.generic.aliases.blue.endpoint=http://localhost:8090/blue-exchange
911
adapters.generic.aliases.ccx.enabled=true
1012
adapters.generic.aliases.ccx.endpoint=http://localhost:8090/ccx-exchange
1113
adapters.generic.aliases.cwire.enabled=true

0 commit comments

Comments
 (0)