Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main/resources/bidder-config/admatic.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
adapters:
admatic:
endpoint: http://pbs.admatic.com.tr?host={{Host}}
aliases:
adt:
enabled: false
meta-info:
maintainer-email: publisher@adtarget.com.tr
vendor-id: 779
meta-info:
maintainer-email: prebid@admatic.com.tr
app-media-types:
Expand Down
37 changes: 37 additions & 0 deletions src/test/java/org/prebid/server/it/AdtTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.prebid.server.it;

import io.restassured.response.Response;
import org.json.JSONException;
import org.junit.jupiter.api.Test;
import org.prebid.server.model.Endpoint;

import java.io.IOException;
import java.util.List;

import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;

public class AdtTest extends IntegrationTest {

@Test
public void openrtb2AuctionShouldRespondWithBidsFromadt() throws IOException, JSONException {
// given
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/adt-exchange"))
.withQueryParam("host", equalTo("host"))
.withRequestBody(equalToJson(jsonFrom("openrtb2/adt/test-adt-bid-request.json")))
.willReturn(aResponse().withBody(jsonFrom("openrtb2/adt/test-adt-bid-response.json"))));

// when
final Response response = responseFor(
"openrtb2/adt/test-auction-adt-request.json",
Endpoint.openrtb2_auction
);

// then
assertJsonEquals("openrtb2/adt/test-auction-adt-response.json", response, List.of("adt"));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"secure": 1,
"banner": {
"w": 320,
"h": 250
},
"ext": {
"tid": "${json-unit.any-string}",
"bidder": {
"host": "host",
"networkId": 4
}
}
}
],
"source": {
"tid": "${json-unit.any-string}"
},
"site": {
"domain": "www.example.com",
"page": "http://www.example.com",
"publisher": {
"domain": "example.com"
},
"ext": {
"amp": 0
}
},
"device": {
"ua": "userAgent",
"ip": "193.168.244.1"
},
"at": 1,
"tmax": "${json-unit.any-number}",
"cur": [
"USD"
],
"regs": {
"ext": {
"gdpr": 0
}
},
"ext": {
"prebid": {
"server": {
"externalurl": "http://localhost:8080",
"gvlid": 1,
"datacenter": "local",
"endpoint": "/openrtb2/auction"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"id": "tid",
"seatbid": [
{
"bid": [
{
"crid": "24080",
"adid": "2068416",
"price": 0.01,
"id": "bid_id",
"impid": "imp_id",
"cid": "8048"
}
],
"type": "banner"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"banner": {
"w": 320,
"h": 250
},
"ext": {
"adt": {
"host": "host",
"networkId": 4
}
}
}
],
"tmax": 5000,
"regs": {
"ext": {
"gdpr": 0
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "bid_id",
"impid": "imp_id",
"exp": 300,
"price": 0.01,
"adid": "2068416",
"cid": "8048",
"crid": "24080",
"ext": {
"prebid": {
"type": "banner"
},
"origbidcpm": 0.01
}
}
],
"seat": "adt",
"group": 0
}
],
"cur": "USD",
"ext": {
"responsetimemillis": {
"adt": "{{ adt.response_time_ms }}"
},
"prebid": {
"auctiontimestamp": 0
},
"tmaxrequest": 5000
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ adapters.adman.enabled=true
adapters.adman.endpoint=http://localhost:8090/adman-exchange
adapters.admatic.enabled=true
adapters.admatic.endpoint=http://localhost:8090/admatic-exchange?host={{Host}}
adapters.admatic.aliases.adt.enabled=true
adapters.admatic.aliases.adt.endpoint=http://localhost:8090/adt-exchange?host={{Host}}
adapters.admixer.enabled=true
adapters.admixer.endpoint=http://localhost:8090/admixer-exchange
adapters.adnuntius.enabled=true
Expand Down
Loading