Skip to content

Commit edccca3

Browse files
New Adapter: AdmaticDe - Admatic alias (#3874)
1 parent 628c6b7 commit edccca3

File tree

7 files changed

+175
-0
lines changed

7 files changed

+175
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ adapters:
77
meta-info:
88
maintainer-email: publisher@adtarget.com.tr
99
vendor-id: 779
10+
admaticde:
11+
enabled: false
1012
yobee:
1113
enabled: false
1214
meta-info:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 AdmaticDeTest extends IntegrationTest {
18+
19+
@Test
20+
public void openrtb2AuctionShouldRespondWithBidsFromAdmaticDe() throws IOException, JSONException {
21+
// given
22+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/admaticde-exchange"))
23+
.withQueryParam("host", equalTo("host"))
24+
.withRequestBody(equalToJson(jsonFrom("openrtb2/admaticde/test-admaticde-bid-request.json")))
25+
.willReturn(aResponse().withBody(jsonFrom("openrtb2/admaticde/test-admaticde-bid-response.json"))));
26+
27+
// when
28+
final Response response = responseFor(
29+
"openrtb2/admaticde/test-auction-admaticde-request.json",
30+
Endpoint.openrtb2_auction);
31+
32+
// then
33+
assertJsonEquals("openrtb2/admaticde/test-auction-admaticde-response.json", response, List.of("admaticde"));
34+
}
35+
36+
}
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+
}
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+
"admaticde": {
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: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
},
18+
"origbidcpm": 0.01
19+
}
20+
}
21+
],
22+
"seat": "admaticde",
23+
"group": 0
24+
}
25+
],
26+
"cur": "USD",
27+
"ext": {
28+
"responsetimemillis": {
29+
"admaticde": "{{ admaticde.response_time_ms }}"
30+
},
31+
"prebid": {
32+
"auctiontimestamp": 0
33+
},
34+
"tmaxrequest": 5000
35+
}
36+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ adapters.admatic.enabled=true
3939
adapters.admatic.endpoint=http://localhost:8090/admatic-exchange?host={{Host}}
4040
adapters.admatic.aliases.adt.enabled=true
4141
adapters.admatic.aliases.adt.endpoint=http://localhost:8090/adt-exchange?host={{Host}}
42+
adapters.admatic.aliases.admaticde.enabled=true
43+
adapters.admatic.aliases.admaticde.endpoint=http://localhost:8090/admaticde-exchange?host={{Host}}
4244
adapters.admatic.aliases.yobee.enabled=true
4345
adapters.admatic.aliases.yobee.endpoint=http://localhost:8090/yobee-exchange?host={{Host}}
4446
adapters.admixer.enabled=true

0 commit comments

Comments
 (0)