Skip to content

Commit

Permalink
Adtelligent: Add PGAM alias (#1807)
Browse files Browse the repository at this point in the history
  • Loading branch information
marki1an authored May 3, 2022
1 parent 5b19ae7 commit 7cc41e4
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/resources/bidder-config/adtelligent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ adapters:
redirect-url:
cookie-family-name: viewdeos
streamkey:
enabled: false
endpoint: http://ghb.hb.streamkey.net/pbs/ortb
meta-info:
maintainer-email: contact@streamkey.tv
Expand All @@ -36,6 +37,7 @@ adapters:
redirect-url:
cookie-family-name: streamkey
janet:
enabled: false
endpoint: http://ghb.bidder.jmgads.com/pbs/ortb
meta-info:
maintainer-email: info@thejmg.com
Expand All @@ -50,6 +52,16 @@ adapters:
url:
redirect-url:
cookie-family-name: janet
pgam:
enabled: false
endpoint: http://ghb.pgamssp.com/pbs/ortb
meta-info:
maintainer-email: ppatel@pgammedia.com
vendor-id: 0
usersync:
url:
redirect-url:
cookie-family-name: pgam
meta-info:
maintainer-email: hb@adtelligent.com
app-media-types:
Expand Down
37 changes: 37 additions & 0 deletions src/test/java/org/prebid/server/it/PgamTest.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.Test;
import org.junit.runner.RunWith;
import org.prebid.server.model.Endpoint;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.IOException;

import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
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;
import static java.util.Collections.singletonList;

@RunWith(SpringRunner.class)
public class PgamTest extends IntegrationTest {

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

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

// then
assertJsonEquals("openrtb2/pgam/test-auction-pgam-response.json", response,
singletonList("pgam"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"banner": {
"w": 300,
"h": 250
},
"ext": {
"pgam": {
"aid": 1000,
"siteId": 1234,
"bidFloor": 20,
"placementId": 10
}
}
}
],
"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",
"price": 8.43,
"adm": "adm14",
"crid": "crid14",
"w": 300,
"h": 250,
"ext": {
"prebid": {
"type": "banner"
},
"origbidcpm": 8.43
}
}
],
"seat": "pgam",
"group": 0
}
],
"cur": "USD",
"ext": {
"responsetimemillis": {
"pgam": "{{ pgam.response_time_ms }}"
},
"prebid": {
"auctiontimestamp": 0
},
"tmaxrequest": 5000
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"banner": {
"w": 300,
"h": 250
},
"bidfloor": 20,
"ext": {
"adtelligent": {
"aid": 1000,
"placementId": 10,
"siteId": 1234,
"bidFloor": 20
}
}
}
],
"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": 5000,
"cur": [
"USD"
],
"regs": {
"ext": {
"gdpr": 0
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "bid_id",
"impid": "imp_id",
"price": 8.43,
"adm": "adm14",
"crid": "crid14",
"w": 300,
"h": 250
}
],
"seat": "adtelligent",
"group": 0
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ adapters.adtelligent.aliases.mediafuse.enabled=true
adapters.adtelligent.aliases.viewdeos.enabled=true
adapters.adtelligent.aliases.streamkey.enabled=true
adapters.adtelligent.aliases.janet.enabled=true
adapters.adtelligent.aliases.pgam.enabled=true
adapters.adtelligent.aliases.pgam.endpoint=http://localhost:8090/pgam-exchange
adapters.advangelists.enabled=true
adapters.advangelists.endpoint=http://localhost:8090/advangelists-exchange?pubid={{PublisherID}}
adapters.adxcg.enabled=true
Expand Down

0 comments on commit 7cc41e4

Please sign in to comment.