Skip to content

Commit 7a61e9f

Browse files
authored
Ybidder: New Nexx360 alias (#4467)
1 parent c2a86cf commit 7a61e9f

7 files changed

Lines changed: 187 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ adapters:
66
1accord: ~
77
easybid: ~
88
prismassp: ~
9+
ybidder:
10+
enabled: false
11+
meta-info:
12+
maintainer-email: team@yieldbird.com
13+
vendor-id: 1253
914
meta-info:
1015
maintainer-email: tech@nexx360.io
1116
app-media-types:
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 YbidderTest extends IntegrationTest {
18+
19+
@Test
20+
public void openrtb2AuctionShouldRespondWithBidsFromYbidder() throws IOException, JSONException {
21+
// given
22+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/ybidder-exchange"))
23+
.withQueryParam("placement", equalTo("placement"))
24+
.withRequestBody(equalToJson(jsonFrom("openrtb2/ybidder/test-ybidder-bid-request.json")))
25+
.willReturn(aResponse().withBody(jsonFrom("openrtb2/ybidder/test-ybidder-bid-response.json"))));
26+
27+
// when
28+
final Response response = responseFor("openrtb2/ybidder/test-auction-ybidder-request.json",
29+
Endpoint.openrtb2_auction);
30+
31+
// then
32+
assertJsonEquals("openrtb2/ybidder/test-auction-ybidder-response.json", response, singletonList("ybidder"));
33+
}
34+
}
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+
"ybidder": {
12+
"placement": "placement"
13+
}
14+
}
15+
}
16+
],
17+
"tmax": 5000,
18+
"regs": {
19+
"ext": {
20+
"gdpr": 0
21+
}
22+
}
23+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"exp": 300,
10+
"mtype": 1,
11+
"price": 5.78,
12+
"adm": "adm00",
13+
"crid": "crid00",
14+
"w": 300,
15+
"h": 250,
16+
"ext": {
17+
"origbidcpm": 5.78,
18+
"prebid": {
19+
"type": "banner",
20+
"meta": {
21+
"adaptercode": "ybidder"
22+
}
23+
},
24+
"bidType": "banner"
25+
}
26+
}
27+
],
28+
"seat": "ybidder",
29+
"group": 0
30+
}
31+
],
32+
"cur": "USD",
33+
"ext": {
34+
"responsetimemillis": {
35+
"ybidder": "{{ ybidder.response_time_ms }}"
36+
},
37+
"prebid": {
38+
"auctiontimestamp": 0
39+
},
40+
"tmaxrequest": 5000
41+
}
42+
}
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+
"banner": {
7+
"w": 300,
8+
"h": 250
9+
},
10+
"secure": 1,
11+
"ext": {
12+
"tid": "${json-unit.any-string}",
13+
"nexx360": {
14+
"placement": "placement"
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+
"nexx360": {
48+
"caller": [
49+
{
50+
"name": "Prebid-Server",
51+
"version": "${json-unit.any-string}"
52+
}
53+
]
54+
}
55+
}
56+
}
57+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"mtype": 1,
10+
"price": 5.78,
11+
"adm": "adm00",
12+
"crid": "crid00",
13+
"w": 300,
14+
"h": 250,
15+
"ext": {
16+
"bidType": "banner"
17+
}
18+
}
19+
],
20+
"seat": "seatId00",
21+
"group": 0
22+
}
23+
]
24+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ adapters.nexx360.aliases.prismassp.enabled=true
417417
adapters.nexx360.aliases.prismassp.endpoint=http://localhost:8090/prismassp-exchange
418418
adapters.nexx360.aliases.easybid.enabled=true
419419
adapters.nexx360.aliases.easybid.endpoint=http://localhost:8090/easybid-exchange
420+
adapters.nexx360.aliases.ybidder.enabled=true
421+
adapters.nexx360.aliases.ybidder.endpoint=http://localhost:8090/ybidder-exchange
420422
adapters.nobid.enabled=true
421423
adapters.nobid.endpoint=http://localhost:8090/nobid-exchange?pubid=
422424
adapters.ogury.enabled=true

0 commit comments

Comments
 (0)