Skip to content

Commit 624fa64

Browse files
Adkernel Alias: Xapads (#4242)
1 parent fb1879e commit 624fa64

File tree

9 files changed

+193
-3
lines changed

9 files changed

+193
-3
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ adapters:
55
aliases:
66
rxnetwork: ~
77
152media: ~
8+
xapads:
9+
enabled: false
10+
vendor-id: 1320
11+
usersync:
12+
enabled: true
13+
cookie-family-name: xapads
14+
redirect:
15+
url: https://sync.adkernel.com/user-sync?t=image&zone=284803&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}}&r={{redirect_url}}
16+
support-cors: false
17+
uid-macro: '{UID}'
18+
iframe:
19+
url: https://sync.adkernel.com/user-sync?t=iframe&zone=284803&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}}&r={{redirect_url}}
20+
support-cors: false
21+
uid-macro: '{UID}'
822
meta-info:
923
maintainer-email: prebid-dev@adkernel.com
1024
app-media-types:

src/test/java/org/prebid/server/it/OneFiveTwoMediaTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class OneFiveTwoMediaTest extends IntegrationTest {
1818
@Test
1919
public void openrtb2AuctionShouldRespondWithBidsFrom152Media() throws IOException, JSONException {
2020
// given
21-
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/adkernel-exchange"))
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/152media-exchange"))
2222
.withRequestBody(equalToJson(jsonFrom("openrtb2/152media/test-152media-bid-request.json")))
2323
.willReturn(aResponse().withBody(jsonFrom("openrtb2/152media/test-152media-bid-response.json"))));
2424

src/test/java/org/prebid/server/it/RxNetworkTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class RxNetworkTest extends IntegrationTest {
1818
@Test
1919
public void openrtb2AuctionShouldRespondWithBidsFromRxNetwork() throws IOException, JSONException {
2020
// given
21-
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/adkernel-exchange"))
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/rxnetwork-exchange"))
2222
.withRequestBody(equalToJson(jsonFrom("openrtb2/rxnetwork/test-rxnetwork-bid-request.json")))
2323
.willReturn(aResponse().withBody(jsonFrom("openrtb2/rxnetwork/test-rxnetwork-bid-response.json"))));
2424

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 XapadsTest extends IntegrationTest {
17+
18+
@Test
19+
public void openrtb2AuctionShouldRespondWithBidsFromXapads() throws IOException, JSONException {
20+
// given
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/xapads-exchange"))
22+
.withRequestBody(equalToJson(jsonFrom("openrtb2/xapads/test-xapads-bid-request.json")))
23+
.willReturn(aResponse().withBody(jsonFrom("openrtb2/xapads/test-xapads-bid-response.json"))));
24+
25+
// when
26+
final Response response = responseFor("openrtb2/xapads/test-auction-xapads-request.json",
27+
Endpoint.openrtb2_auction);
28+
29+
// then
30+
assertJsonEquals("openrtb2/xapads/test-auction-xapads-response.json", response,
31+
singletonList("xapads"));
32+
}
33+
}
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+
"xapads": {
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": "xapads"
24+
}
25+
},
26+
"origbidcpm": 2.25
27+
}
28+
}
29+
],
30+
"seat": "xapads",
31+
"group": 0
32+
}
33+
],
34+
"cur": "USD",
35+
"ext": {
36+
"responsetimemillis": {
37+
"xapads": "{{ xapads.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+
}
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+
}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ adapters.adhese.endpoint=http://localhost:8090/adhese-exchange
3434
adapters.adkerneladn.enabled=true
3535
adapters.adkerneladn.endpoint=http://localhost:8090/adkerneladn-exchange?account={{PublisherID}}
3636
adapters.adkernel.enabled=true
37-
adapters.adkernel.endpoint=http://localhost:8090/adkernel-exchange?zone=%s
37+
adapters.adkernel.endpoint=http://localhost:8090/adkernel-exchange
38+
adapters.adkernel.aliases.xapads.enabled=true
39+
adapters.adkernel.aliases.xapads.endpoint=http://localhost:8090/xapads-exchange
40+
adapters.adkernel.aliases.rxnetwork.enabled=true
41+
adapters.adkernel.aliases.rxnetwork.endpoint=http://localhost:8090/rxnetwork-exchange
42+
adapters.adkernel.aliases.152media.enabled=true
43+
adapters.adkernel.aliases.152media.endpoint=http://localhost:8090/152media-exchange
3844
adapters.adman.enabled=true
3945
adapters.adman.endpoint=http://localhost:8090/adman-exchange
4046
adapters.admatic.enabled=true

0 commit comments

Comments
 (0)