Skip to content

Commit 81bd38f

Browse files
Admatic Alias: Netaddiction (#4018)
1 parent 3fdc4d4 commit 81bd38f

7 files changed

Lines changed: 184 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ adapters:
2121
enabled: false
2222
meta-info:
2323
maintainer-email: adops@yobee.it
24+
netaddiction:
25+
meta-info:
26+
maintainer-email: publishers-support@netaddiction.it
2427
meta-info:
2528
maintainer-email: prebid@admatic.com.tr
2629
app-media-types:
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
import java.util.List;
10+
11+
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
12+
import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
13+
import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;
14+
import static com.github.tomakehurst.wiremock.client.WireMock.post;
15+
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
16+
17+
public class NetAddictionTest extends IntegrationTest {
18+
19+
@Test
20+
public void openrtb2AuctionShouldRespondWithBidsFromNetaddiction() throws IOException, JSONException {
21+
// given
22+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/netaddiction-exchange"))
23+
.withQueryParam("host", equalTo("host"))
24+
.withRequestBody(equalToJson(
25+
jsonFrom("openrtb2/netaddiction/test-netaddiction-bid-request.json")))
26+
.willReturn(aResponse().withBody(
27+
jsonFrom("openrtb2/netaddiction/test-netaddiction-bid-response.json"))));
28+
29+
// when
30+
final Response response = responseFor(
31+
"openrtb2/netaddiction/test-auction-netaddiction-request.json",
32+
Endpoint.openrtb2_auction);
33+
34+
// then
35+
assertJsonEquals(
36+
"openrtb2/netaddiction/test-auction-netaddiction-response.json",
37+
response,
38+
List.of("netaddiction"));
39+
}
40+
41+
}
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": 320,
8+
"h": 250
9+
},
10+
"ext": {
11+
"netaddiction": {
12+
"host": "host",
13+
"networkId": 4
14+
}
15+
}
16+
}
17+
],
18+
"tmax": 5000,
19+
"regs": {
20+
"ext": {
21+
"gdpr": 0
22+
}
23+
}
24+
}
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": 0.01,
11+
"adid": "2068416",
12+
"cid": "8048",
13+
"crid": "24080",
14+
"ext": {
15+
"prebid": {
16+
"type": "banner",
17+
"meta": {
18+
"adaptercode": "netaddiction"
19+
}
20+
},
21+
"origbidcpm": 0.01
22+
}
23+
}
24+
],
25+
"seat": "netaddiction",
26+
"group": 0
27+
}
28+
],
29+
"cur": "USD",
30+
"ext": {
31+
"responsetimemillis": {
32+
"netaddiction": "{{ netaddiction.response_time_ms }}"
33+
},
34+
"prebid": {
35+
"auctiontimestamp": 0
36+
},
37+
"tmaxrequest": 5000
38+
}
39+
}
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": 320,
9+
"h": 250
10+
},
11+
"ext": {
12+
"tid": "${json-unit.any-string}",
13+
"bidder": {
14+
"host": "host",
15+
"networkId": 4
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+
"cur": [
40+
"USD"
41+
],
42+
"regs": {
43+
"ext": {
44+
"gdpr": 0
45+
}
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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"id": "tid",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"crid": "24080",
8+
"adid": "2068416",
9+
"price": 0.01,
10+
"id": "bid_id",
11+
"impid": "imp_id",
12+
"cid": "8048"
13+
}
14+
],
15+
"type": "banner"
16+
}
17+
]
18+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ adapters.admatic.aliases.admaticde.enabled=true
4747
adapters.admatic.aliases.admaticde.endpoint=http://localhost:8090/admaticde-exchange?host={{Host}}
4848
adapters.admatic.aliases.yobee.enabled=true
4949
adapters.admatic.aliases.yobee.endpoint=http://localhost:8090/yobee-exchange?host={{Host}}
50+
adapters.admatic.aliases.netaddiction.enabled=true
51+
adapters.admatic.aliases.netaddiction.endpoint=http://localhost:8090/netaddiction-exchange?host={{Host}}
5052
adapters.admixer.enabled=true
5153
adapters.admixer.endpoint=http://localhost:8090/admixer-exchange
5254
adapters.adnuntius.enabled=true

0 commit comments

Comments
 (0)