Skip to content

Commit 2f94f92

Browse files
Xeworks Adapter: Adipolo Alias (#4169)
1 parent 3c20907 commit 2f94f92

File tree

7 files changed

+198
-0
lines changed

7 files changed

+198
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ adapters:
77
endpoint: http://rtb.connektai.live/?pid={{SourceId}}&host={{Host}}&s=pbs
88
meta-info:
99
maintainer-email: adops@connekt.ai
10+
adipolo:
11+
enabled: false
12+
endpoint: http://rtb.adipolo.live?pid={{SourceId}}&host={{Host}}&pbs=1
13+
meta-info:
14+
maintainer-email: smart@adipolo.com
15+
usersync:
16+
enabled: true
17+
cookie-family-name: adipolo
18+
redirect:
19+
url: https://sync.adipolo.live/psync?t=s&e=0&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}}&cb={{redirect_url}}
20+
support-cors: false
21+
uid-macro: '$UID'
22+
iframe:
23+
url: https://sync.adipolo.live/static/adisync.html?gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}}&cb={{redirect_url}}
24+
support-cors: false
25+
uid-macro: '$UID'
1026
meta-info:
1127
maintainer-email: team@xe.works
1228
app-media-types:
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 AdipoloTest extends IntegrationTest {
17+
18+
@Test
19+
public void openrtb2AuctionShouldRespondWithBidsFromAdipolo() throws IOException, JSONException {
20+
// given
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/adipolo-exchange"))
22+
.withRequestBody(equalToJson(
23+
jsonFrom("openrtb2/adipolo/test-adipolo-bid-request.json")))
24+
.willReturn(aResponse().withBody(
25+
jsonFrom("openrtb2/adipolo/test-adipolo-bid-response.json"))));
26+
27+
// when
28+
final Response response = responseFor("openrtb2/adipolo/test-auction-adipolo-request.json",
29+
Endpoint.openrtb2_auction);
30+
31+
// then
32+
assertJsonEquals("openrtb2/adipolo/test-auction-adipolo-response.json", response,
33+
singletonList("adipolo"));
34+
}
35+
}
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+
"secure": 1,
7+
"banner": {
8+
"w": 300,
9+
"h": 250
10+
},
11+
"ext": {
12+
"tid": "${json-unit.any-string}",
13+
"bidder": {
14+
"env": "envValue",
15+
"pid": "pidValue"
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+
"regs": {
40+
"ext": {
41+
"gdpr": 0
42+
}
43+
},
44+
"cur": [
45+
"USD"
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: 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+
"adm": "some adm value",
10+
"price": 10,
11+
"adomain": [],
12+
"crid": "test-creative-id-1",
13+
"ext": {
14+
"prebid": {
15+
"type": "banner"
16+
}
17+
}
18+
}
19+
]
20+
}
21+
],
22+
"cur": "EUR"
23+
}
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+
"adipolo": {
12+
"env": "envValue",
13+
"pid": "pidValue"
14+
}
15+
}
16+
}
17+
],
18+
"tmax": 5000,
19+
"regs": {
20+
"ext": {
21+
"gdpr": 0
22+
}
23+
}
24+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"exp": 300,
10+
"price": 11.393,
11+
"adm": "some adm value",
12+
"adomain": [
13+
],
14+
"crid": "test-creative-id-1",
15+
"ext": {
16+
"prebid": {
17+
"type": "banner",
18+
"meta": {
19+
"adaptercode": "adipolo"
20+
}
21+
},
22+
"origbidcpm": 10,
23+
"origbidcur": "EUR"
24+
}
25+
}
26+
],
27+
"seat": "adipolo",
28+
"group": 0
29+
}
30+
],
31+
"cur": "USD",
32+
"ext": {
33+
"responsetimemillis": {
34+
"adipolo": "{{ adipolo.response_time_ms }}"
35+
},
36+
"tmaxrequest": 5000,
37+
"prebid": {
38+
"auctiontimestamp": 0
39+
}
40+
}
41+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,8 @@ adapters.xeworks.enabled=true
604604
adapters.xeworks.endpoint=http://localhost:8090/xeworks-exchange
605605
adapters.xeworks.aliases.connektai.enabled=true
606606
adapters.xeworks.aliases.connektai.endpoint=http://localhost:8090/connektai-exchange
607+
adapters.xeworks.aliases.adipolo.enabled=true
608+
adapters.xeworks.aliases.adipolo.endpoint=http://localhost:8090/adipolo-exchange
607609
adapters.vidazoo.enabled=true
608610
adapters.vidazoo.endpoint=http://localhost:8090/vidazoo-exchange/
609611
adapters.vidazoo.aliases.progx.enabled=true

0 commit comments

Comments
 (0)