Skip to content

Commit 69b1993

Browse files
New Adapter: Harrenmedia - Adverxo alias (#4472)
1 parent 9458ac2 commit 69b1993

7 files changed

Lines changed: 218 additions & 0 deletions

File tree

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ adapters:
3131
url: https://taetee.com/usync?type=image&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redirect={{redirect_url}}
3232
uid-macro: '$UID'
3333
support-cors: false
34+
harrenmedia:
35+
enabled: false
36+
endpoint: https://harrenmedia.pbsadverxo.com/auction?id={{adUnitId}}&auth={{auth}}
37+
usersync:
38+
enabled: false
39+
cookie-family-name: harrenmedia
40+
iframe:
41+
url: https://hmidssp.com/usync?type=iframe&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redirect={{redirect_url}}
42+
uid-macro: '$UID'
43+
support-cors: false
44+
redirect:
45+
url: https://hmidssp.com/usync?type=image&gdpr={{gdpr}}&consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redirect={{redirect_url}}
46+
uid-macro: '$UID'
47+
support-cors: false
3448
meta-info:
3549
maintainer-email: developer@adverxo.com
3650
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.equalToJson;
12+
import static com.github.tomakehurst.wiremock.client.WireMock.post;
13+
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
14+
import static java.util.Collections.singletonList;
15+
16+
public class HarrenmediaTest extends IntegrationTest {
17+
18+
@Test
19+
public void openrtb2AuctionShouldRespondWithBidsFromTheHarrenmedia() throws IOException, JSONException {
20+
// given
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/harrenmedia-exchange"))
22+
.withRequestBody(equalToJson(jsonFrom("openrtb2/harrenmedia/test-harrenmedia-bid-request.json"),
23+
true, true))
24+
.willReturn(aResponse().withBody(jsonFrom("openrtb2/harrenmedia/test-harrenmedia-bid-response.json"))));
25+
26+
// when
27+
final Response response = responseFor("openrtb2/harrenmedia/test-auction-harrenmedia-request.json",
28+
Endpoint.openrtb2_auction);
29+
30+
// then
31+
assertJsonEquals("openrtb2/harrenmedia/test-auction-harrenmedia-response.json", response,
32+
singletonList("harrenmedia"));
33+
}
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"id": "test-auction-request",
3+
"imp": [
4+
{
5+
"id": "imp1",
6+
"banner": {
7+
"format": [
8+
{
9+
"w": 300,
10+
"h": 250
11+
}
12+
]
13+
},
14+
"ext": {
15+
"harrenmedia": {
16+
"adUnitId": 1,
17+
"auth": "123456"
18+
}
19+
}
20+
}
21+
],
22+
"site": {
23+
"page": "http://testpage.com"
24+
},
25+
"device": {
26+
"ua": "Mozilla/5.0"
27+
},
28+
"tmax": 5000,
29+
"regs": {
30+
"ext": {
31+
"gdpr": 0
32+
}
33+
}
34+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"id": "test-auction-request",
3+
"seatbid": [
4+
{
5+
"seat": "harrenmedia",
6+
"group": 0,
7+
"bid": [
8+
{
9+
"id": "bid1",
10+
"impid": "imp1",
11+
"price": 1.23,
12+
"adm": "<script>Ad markup with 1.23</script>",
13+
"nurl": "https://example.com/win?price=1.23",
14+
"crid": "creative1",
15+
"w": 300,
16+
"h": 250,
17+
"exp": 300,
18+
"mtype": 1,
19+
"ext": {
20+
"origbidcpm": 1.23,
21+
"origbidcur": "USD",
22+
"prebid": {
23+
"type": "banner",
24+
"meta": {
25+
"adaptercode": "harrenmedia"
26+
}
27+
}
28+
}
29+
}
30+
]
31+
}
32+
],
33+
"cur": "USD",
34+
"ext": {
35+
"responsetimemillis": {
36+
"harrenmedia": 0
37+
},
38+
"tmaxrequest": 5000,
39+
"prebid": {
40+
"auctiontimestamp": 0
41+
}
42+
}
43+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"id": "test-auction-request",
3+
"imp": [
4+
{
5+
"id": "imp1",
6+
"banner": {
7+
"format": [
8+
{
9+
"w": 300,
10+
"h": 250
11+
}
12+
]
13+
},
14+
"secure": 1,
15+
"ext": {
16+
"tid": "${json-unit.any-string}",
17+
"bidder": {
18+
"adUnitId": 1,
19+
"auth": "123456"
20+
}
21+
}
22+
}
23+
],
24+
"site": {
25+
"domain": "testpage.com",
26+
"page": "http://testpage.com",
27+
"publisher": {
28+
"domain": "testpage.com"
29+
},
30+
"ext": {
31+
"amp": 0
32+
}
33+
},
34+
"device": {
35+
"ua": "Mozilla/5.0",
36+
"ip": "193.168.244.1"
37+
},
38+
"at": 1,
39+
"tmax": "${json-unit.any-number}",
40+
"cur": [
41+
"USD"
42+
],
43+
"source": {
44+
"tid": "${json-unit.any-string}"
45+
},
46+
"regs": {
47+
"ext": {
48+
"gdpr": 0
49+
}
50+
}
51+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"id": "test-auction-request",
3+
"seatbid": [
4+
{
5+
"seat": "harrenmedia",
6+
"group": 0,
7+
"bid": [
8+
{
9+
"id": "bid1",
10+
"impid": "imp1",
11+
"price": 1.23,
12+
"adm": "<script>Ad markup with 1.23</script>",
13+
"nurl": "https://example.com/win?price=1.23",
14+
"crid": "creative1",
15+
"w": 300,
16+
"h": 250,
17+
"exp": 300,
18+
"mtype": 1,
19+
"ext": {
20+
"origbidcpm": 1.23,
21+
"origbidcur": "USD",
22+
"prebid": {
23+
"type": "banner"
24+
}
25+
}
26+
}
27+
]
28+
}
29+
],
30+
"cur": "USD",
31+
"ext": {
32+
"responsetimemillis": {
33+
"bidsmind": 0
34+
},
35+
"tmaxrequest": 5000,
36+
"prebid": {
37+
"auctiontimestamp": 0
38+
}
39+
}
40+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ adapters.adverxo.aliases.adport.enabled=true
7272
adapters.adverxo.aliases.adport.endpoint=http://localhost:8090/adport-exchange
7373
adapters.adverxo.aliases.bidsmind.enabled=true
7474
adapters.adverxo.aliases.bidsmind.endpoint=http://localhost:8090/bidsmind-exchange
75+
adapters.adverxo.aliases.harrenmedia.enabled=true
76+
adapters.adverxo.aliases.harrenmedia.endpoint=http://localhost:8090/harrenmedia-exchange
7577
adapters.adview.enabled=true
7678
adapters.adview.endpoint=http://localhost:8090/adview-exchange?accountId={{AccountId}}
7779
adapters.adprime.enabled=true

0 commit comments

Comments
 (0)