Skip to content

Commit 5aeaea2

Browse files
authored
New Adapter: 152 Media - Adkernel alias (#3829)
1 parent 1e66556 commit 5aeaea2

File tree

11 files changed

+341
-0
lines changed

11 files changed

+341
-0
lines changed

src/main/resources/bidder-config/adkernel.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ adapters:
44
endpoint-compression: gzip
55
aliases:
66
rxnetwork: ~
7+
152media: ~
78
meta-info:
89
maintainer-email: prebid-dev@adkernel.com
910
app-media-types:
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 OneFiveTwoMediaTest extends IntegrationTest {
17+
18+
@Test
19+
public void openrtb2AuctionShouldRespondWithBidsFrom152Media() throws IOException, JSONException {
20+
// given
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/adkernel-exchange"))
22+
.withRequestBody(equalToJson(jsonFrom("openrtb2/152media/test-152media-bid-request.json")))
23+
.willReturn(aResponse().withBody(jsonFrom("openrtb2/152media/test-152media-bid-response.json"))));
24+
25+
// when
26+
final Response response = responseFor("openrtb2/152media/test-auction-152media-request.json",
27+
Endpoint.openrtb2_auction);
28+
29+
// then
30+
assertJsonEquals("openrtb2/152media/test-auction-152media-response.json", response,
31+
singletonList("152media"));
32+
}
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 RxNetworkTest extends IntegrationTest {
17+
18+
@Test
19+
public void openrtb2AuctionShouldRespondWithBidsFromRxNetwork() throws IOException, JSONException {
20+
// given
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/adkernel-exchange"))
22+
.withRequestBody(equalToJson(jsonFrom("openrtb2/rxnetwork/test-rxnetwork-bid-request.json")))
23+
.willReturn(aResponse().withBody(jsonFrom("openrtb2/rxnetwork/test-rxnetwork-bid-response.json"))));
24+
25+
// when
26+
final Response response = responseFor("openrtb2/rxnetwork/test-auction-rxnetwork-request.json",
27+
Endpoint.openrtb2_auction);
28+
29+
// then
30+
assertJsonEquals("openrtb2/rxnetwork/test-auction-rxnetwork-response.json", response,
31+
singletonList("rxnetwork"));
32+
}
33+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"id": "request_id",
3+
"imp": [
4+
{
5+
"id": "imp_id",
6+
"secure": 1,
7+
"banner": {
8+
"w": 320,
9+
"h": 250
10+
}
11+
}
12+
],
13+
"source": {
14+
"tid": "${json-unit.any-string}"
15+
},
16+
"site": {
17+
"domain": "www.example.com",
18+
"page": "http://www.example.com",
19+
"ext": {
20+
"amp": 0
21+
}
22+
},
23+
"device": {
24+
"ua": "userAgent",
25+
"ip": "193.168.244.1"
26+
},
27+
"at": 1,
28+
"tmax": "${json-unit.any-number}",
29+
"cur": [
30+
"USD"
31+
],
32+
"regs": {
33+
"ext": {
34+
"gdpr": 0
35+
}
36+
},
37+
"ext": {
38+
"prebid": {
39+
"server": {
40+
"externalurl": "http://localhost:8080",
41+
"gvlid": 1,
42+
"datacenter": "local",
43+
"endpoint": "/openrtb2/auction"
44+
}
45+
}
46+
}
47+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"price": 2.25,
10+
"cid": "1001",
11+
"crid": "2002",
12+
"adid": "2002",
13+
"adm": "<!-- admarkup -->",
14+
"mtype": 1,
15+
"adomain": [
16+
"tag-example.com"
17+
]
18+
}
19+
]
20+
}
21+
],
22+
"bidid": "bid_id"
23+
}
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": 320,
8+
"h": 250
9+
},
10+
"ext": {
11+
"152media": {
12+
"zoneId": 101
13+
}
14+
}
15+
}
16+
],
17+
"tmax": 5000,
18+
"regs": {
19+
"ext": {
20+
"gdpr": 0
21+
}
22+
}
23+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"exp": 300,
10+
"price": 2.25,
11+
"adm": "<!-- admarkup -->",
12+
"adid": "2002",
13+
"adomain": [
14+
"tag-example.com"
15+
],
16+
"cid": "1001",
17+
"crid": "2002",
18+
"mtype": 1,
19+
"ext": {
20+
"prebid": {
21+
"type": "banner",
22+
"meta": {
23+
"adaptercode": "152media"
24+
}
25+
},
26+
"origbidcpm": 2.25
27+
}
28+
}
29+
],
30+
"seat": "152media",
31+
"group": 0
32+
}
33+
],
34+
"cur": "USD",
35+
"ext": {
36+
"responsetimemillis": {
37+
"152media": "{{ 152media.response_time_ms }}"
38+
},
39+
"prebid": {
40+
"auctiontimestamp": 0
41+
},
42+
"tmaxrequest": 5000
43+
}
44+
}
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": 320,
8+
"h": 250
9+
},
10+
"ext": {
11+
"rxnetwork": {
12+
"zoneId": 101
13+
}
14+
}
15+
}
16+
],
17+
"tmax": 5000,
18+
"regs": {
19+
"ext": {
20+
"gdpr": 0
21+
}
22+
}
23+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"exp": 300,
10+
"price": 2.25,
11+
"adm": "<!-- admarkup -->",
12+
"adid": "2002",
13+
"adomain": [
14+
"tag-example.com"
15+
],
16+
"cid": "1001",
17+
"crid": "2002",
18+
"mtype": 1,
19+
"ext": {
20+
"prebid": {
21+
"type": "banner",
22+
"meta": {
23+
"adaptercode": "rxnetwork"
24+
}
25+
},
26+
"origbidcpm": 2.25
27+
}
28+
}
29+
],
30+
"seat": "rxnetwork",
31+
"group": 0
32+
}
33+
],
34+
"cur": "USD",
35+
"ext": {
36+
"responsetimemillis": {
37+
"rxnetwork": "{{ rxnetwork.response_time_ms }}"
38+
},
39+
"prebid": {
40+
"auctiontimestamp": 0
41+
},
42+
"tmaxrequest": 5000
43+
}
44+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"id": "request_id",
3+
"imp": [
4+
{
5+
"id": "imp_id",
6+
"secure": 1,
7+
"banner": {
8+
"w": 320,
9+
"h": 250
10+
}
11+
}
12+
],
13+
"source": {
14+
"tid": "${json-unit.any-string}"
15+
},
16+
"site": {
17+
"domain": "www.example.com",
18+
"page": "http://www.example.com",
19+
"ext": {
20+
"amp": 0
21+
}
22+
},
23+
"device": {
24+
"ua": "userAgent",
25+
"ip": "193.168.244.1"
26+
},
27+
"at": 1,
28+
"tmax": "${json-unit.any-number}",
29+
"cur": [
30+
"USD"
31+
],
32+
"regs": {
33+
"ext": {
34+
"gdpr": 0
35+
}
36+
},
37+
"ext": {
38+
"prebid": {
39+
"server": {
40+
"externalurl": "http://localhost:8080",
41+
"gvlid": 1,
42+
"datacenter": "local",
43+
"endpoint": "/openrtb2/auction"
44+
}
45+
}
46+
}
47+
}

0 commit comments

Comments
 (0)