Skip to content

Commit b5a9b28

Browse files
New adapter: Connektai - Xeworks alias #3730 (#3738)
1 parent 352f851 commit b5a9b28

File tree

7 files changed

+185
-0
lines changed

7 files changed

+185
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
adapters:
22
xeworks:
33
endpoint: http://prebid-srv.xe.works/?pid={{SourceId}}&host={{Host}}
4+
aliases:
5+
connektai:
6+
enabled: false
7+
endpoint: http://rtb.connektai.live/?pid={{SourceId}}&host={{Host}}&s=pbs
8+
meta-info:
9+
maintainer-email: [email protected]
410
meta-info:
511
maintainer-email: [email protected]
612
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 ConnektaiTest extends IntegrationTest {
17+
18+
@Test
19+
public void openrtb2AuctionShouldRespondWithBidsFromConnektai() throws IOException, JSONException {
20+
// given
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/connektai-exchange"))
22+
.withRequestBody(equalToJson(
23+
jsonFrom("openrtb2/connektai/test-connektai-bid-request.json")))
24+
.willReturn(aResponse().withBody(
25+
jsonFrom("openrtb2/connektai/test-connektai-bid-response.json"))));
26+
27+
// when
28+
final Response response = responseFor("openrtb2/connektai/test-auction-connektai-request.json",
29+
Endpoint.openrtb2_auction);
30+
31+
// then
32+
assertJsonEquals("openrtb2/connektai/test-auction-connektai-response.json", response,
33+
singletonList("connektai"));
34+
}
35+
}
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+
"connektai": {
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: 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": 11.393,
11+
"adm": "some adm value",
12+
"adomain": [
13+
],
14+
"crid": "test-creative-id-1",
15+
"ext": {
16+
"prebid": {
17+
"type": "banner"
18+
},
19+
"origbidcpm": 10,
20+
"origbidcur": "EUR"
21+
}
22+
}
23+
],
24+
"seat": "connektai",
25+
"group": 0
26+
}
27+
],
28+
"cur": "USD",
29+
"ext": {
30+
"responsetimemillis": {
31+
"connektai": "{{ connektai.response_time_ms }}"
32+
},
33+
"tmaxrequest": 5000,
34+
"prebid": {
35+
"auctiontimestamp": 0
36+
}
37+
}
38+
}
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+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,8 @@ adapters.vrtcal.enabled=true
504504
adapters.vrtcal.endpoint=http://localhost:8090/vrtcal-exchange
505505
adapters.xeworks.enabled=true
506506
adapters.xeworks.endpoint=http://localhost:8090/xeworks-exchange
507+
adapters.xeworks.aliases.connektai.enabled=true
508+
adapters.xeworks.aliases.connektai.endpoint=http://localhost:8090/connektai-exchange
507509
adapters.vidazoo.enabled=true
508510
adapters.vidazoo.endpoint=http://localhost:8090/vidazoo-exchange/
509511
adapters.videobyte.enabled=true

0 commit comments

Comments
 (0)