Skip to content

Commit 46c66d3

Browse files
AntoxaAntoxicRitesh Ghodrao
authored andcommitted
Aso Adapter: New Kuantyx Alias (prebid#4097)
1 parent fcc43e8 commit 46c66d3

7 files changed

Lines changed: 184 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ adapters:
1212
endpoint: https://srv.bidgx.com/pbs/bidder?zid={{ZoneID}}
1313
meta-info:
1414
maintainer-email: aso@bidgency.com
15+
kuantyx:
16+
enabled: false
17+
endpoint: https://srv.kntxy.com/pbs/bidder?zid={{ZoneID}}
18+
meta-info:
19+
maintainer-email: ssp@kuantyx.com
1520
meta-info:
1621
maintainer-email: support@adsrv.org
1722
app-media-types:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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.equalTo;
12+
import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;
13+
import static com.github.tomakehurst.wiremock.client.WireMock.post;
14+
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
15+
import static java.util.Collections.singletonList;
16+
17+
public class KuantyxTest extends IntegrationTest {
18+
19+
@Test
20+
public void openrtb2AuctionShouldRespondWithBidsFromKuantyx() throws IOException, JSONException {
21+
// given
22+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/kuantyx-exchange"))
23+
.withQueryParam("zid", equalTo("1"))
24+
.withRequestBody(equalToJson(
25+
jsonFrom("openrtb2/kuantyx/test-kuantyx-bid-request.json")))
26+
.willReturn(aResponse().withBody(
27+
jsonFrom("openrtb2/kuantyx/test-kuantyx-bid-response.json"))));
28+
29+
// when
30+
final Response response = responseFor("openrtb2/kuantyx/test-auction-kuantyx-request.json",
31+
Endpoint.openrtb2_auction);
32+
33+
// then
34+
assertJsonEquals("openrtb2/kuantyx/test-auction-kuantyx-response.json", response,
35+
singletonList("kuantyx"));
36+
}
37+
}
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": 300,
8+
"h": 250
9+
},
10+
"ext": {
11+
"kuantyx": {
12+
"zone" : 1
13+
}
14+
}
15+
}
16+
],
17+
"tmax": 5000,
18+
"regs": {
19+
"ext": {
20+
"gdpr": 0
21+
}
22+
}
23+
}
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": 4.7,
11+
"adm": "adm6_4.7",
12+
"nurl": "nurl_4.7",
13+
"crid": "crid6",
14+
"ext": {
15+
"prebid": {
16+
"type": "banner",
17+
"meta": {
18+
"adaptercode": "kuantyx"
19+
}
20+
},
21+
"origbidcpm": 4.7
22+
}
23+
}
24+
],
25+
"seat": "kuantyx",
26+
"group": 0
27+
}
28+
],
29+
"cur": "USD",
30+
"ext": {
31+
"responsetimemillis": {
32+
"kuantyx": "{{ kuantyx.response_time_ms }}"
33+
},
34+
"prebid": {
35+
"auctiontimestamp": 0
36+
},
37+
"tmaxrequest": 5000
38+
}
39+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
"zone" : 1
15+
}
16+
}
17+
}
18+
],
19+
"source": {
20+
"tid": "${json-unit.any-string}"
21+
},
22+
"site": {
23+
"domain": "www.example.com",
24+
"page": "http://www.example.com",
25+
"publisher": {
26+
"domain": "example.com"
27+
},
28+
"ext": {
29+
"amp": 0
30+
}
31+
},
32+
"device": {
33+
"ua": "userAgent",
34+
"ip": "193.168.244.1"
35+
},
36+
"at": 1,
37+
"tmax": "${json-unit.any-number}",
38+
"cur": [
39+
"USD"
40+
],
41+
"regs": {
42+
"ext": {
43+
"gdpr": 0
44+
}
45+
},
46+
"ext": {
47+
"prebid": {
48+
"server": {
49+
"externalurl": "http://localhost:8080",
50+
"gvlid": 1,
51+
"datacenter": "local",
52+
"endpoint": "/openrtb2/auction"
53+
}
54+
}
55+
}
56+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"price": 4.7,
10+
"adm": "adm6_${AUCTION_PRICE}",
11+
"nurl": "nurl_${AUCTION_PRICE}",
12+
"crid": "crid6",
13+
"ext": {
14+
"prebid": {
15+
"type": "banner"
16+
}
17+
}
18+
}
19+
]
20+
}
21+
]
22+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ adapters.aso.aliases.bcmint.enabled=true
139139
adapters.aso.aliases.bcmint.endpoint=http://localhost:8090/bcmint-exchange?zid={{ZoneID}}
140140
adapters.aso.aliases.bidagency.enabled=true
141141
adapters.aso.aliases.bidagency.endpoint=http://localhost:8090/bidagency-exchange?zid={{ZoneID}}
142+
adapters.aso.aliases.kuantyx.enabled=true
143+
adapters.aso.aliases.kuantyx.endpoint=http://localhost:8090/kuantyx-exchange?zid={{ZoneID}}
142144
adapters.automatad.enabled=true
143145
adapters.automatad.endpoint=http://localhost:8090/automatad-exchange
144146
adapters.avocet.enabled=true

0 commit comments

Comments
 (0)