Skip to content

Commit 124bc78

Browse files
New-Adapter-Adinify-Alias-of-SmartHub (#3794)
1 parent d9a6458 commit 124bc78

File tree

7 files changed

+187
-0
lines changed

7 files changed

+187
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ adapters:
1717
felixads:
1818
enabled: false
1919
endpoint: https://felixads-prebid.attekmi.com/pbserver/?seat={{AccountID}}&token={{SourceId}}
20+
adinify:
21+
enabled: false
22+
endpoint: https://adinify-prebid.attekmi.com/pbserver/?seat={{AccountID}}&token={{SourceId}}
2023
artechnology:
2124
enabled: false
2225
endpoint: https://artechnology-prebid.attekmi.com/pbserver/?seat={{AccountID}}&token={{SourceId}}
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+
10+
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
11+
import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
12+
import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;
13+
import static com.github.tomakehurst.wiremock.client.WireMock.post;
14+
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
15+
import static java.util.Collections.singletonList;
16+
17+
public class AdinifyTest extends IntegrationTest {
18+
19+
@Test
20+
public void openrtb2AuctionShouldRespondWithBidsFromAdinify() throws IOException, JSONException {
21+
// given
22+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/adinify-exchange"))
23+
.withQueryParam("host", equalTo("someUniquePartnerName"))
24+
.withQueryParam("accountId", equalTo("someSeat"))
25+
.withQueryParam("sourceId", equalTo("someToken"))
26+
.withRequestBody(equalToJson(jsonFrom("openrtb2/adinify/test-adinify-bid-request.json")))
27+
.willReturn(aResponse().withBody(jsonFrom("openrtb2/adinify/test-adinify-bid-response.json"))));
28+
29+
// when
30+
final Response response = responseFor("openrtb2/adinify/test-auction-adinify-request.json",
31+
Endpoint.openrtb2_auction);
32+
33+
// then
34+
assertJsonEquals("openrtb2/adinify/test-auction-adinify-response.json", response, singletonList("adinify"));
35+
}
36+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"id": "request_id",
3+
"imp": [
4+
{
5+
"id": "imp_id",
6+
"secure": 1,
7+
"banner": {
8+
"w": 300,
9+
"h": 250
10+
},
11+
"ext": {
12+
"tid": "${json-unit.any-string}",
13+
"bidder": {
14+
"partnerName": "someUniquePartnerName",
15+
"seat": "someSeat",
16+
"token": "someToken"
17+
}
18+
}
19+
}
20+
],
21+
"source": {
22+
"tid": "${json-unit.any-string}"
23+
},
24+
"site": {
25+
"domain": "www.example.com",
26+
"page": "http://www.example.com",
27+
"publisher": {
28+
"domain": "example.com"
29+
},
30+
"ext": {
31+
"amp": 0
32+
}
33+
},
34+
"device": {
35+
"ua": "userAgent",
36+
"ip": "193.168.244.1"
37+
},
38+
"at": 1,
39+
"tmax": "${json-unit.any-number}",
40+
"cur": [
41+
"USD"
42+
],
43+
"regs": {
44+
"ext": {
45+
"gdpr": 0
46+
}
47+
},
48+
"ext": {
49+
"prebid": {
50+
"server": {
51+
"externalurl": "http://localhost:8080",
52+
"gvlid": 1,
53+
"datacenter": "local",
54+
"endpoint": "/openrtb2/auction"
55+
}
56+
}
57+
}
58+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"price": 3.33,
10+
"adid": "adid001",
11+
"crid": "crid001",
12+
"cid": "cid001",
13+
"adm": "adm001",
14+
"h": 250,
15+
"w": 300,
16+
"ext": {
17+
"mediaType": "video"
18+
}
19+
}
20+
]
21+
}
22+
]
23+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id": "request_id",
3+
"imp": [
4+
{
5+
"id": "imp_id",
6+
"banner": {
7+
"w": 300,
8+
"h": 250
9+
},
10+
"ext": {
11+
"adinify": {
12+
"partnerName": "someUniquePartnerName",
13+
"seat": "someSeat",
14+
"token": "someToken"
15+
}
16+
}
17+
}
18+
],
19+
"tmax": 5000,
20+
"regs": {
21+
"ext": {
22+
"gdpr": 0
23+
}
24+
}
25+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"exp": 1500,
10+
"price": 3.33,
11+
"adm": "adm001",
12+
"adid": "adid001",
13+
"cid": "cid001",
14+
"crid": "crid001",
15+
"w": 300,
16+
"h": 250,
17+
"ext": {
18+
"mediaType": "video",
19+
"origbidcpm": 3.33,
20+
"prebid": {
21+
"type": "video"
22+
}
23+
}
24+
}
25+
],
26+
"seat": "adinify",
27+
"group": 0
28+
}
29+
],
30+
"cur": "USD",
31+
"ext": {
32+
"responsetimemillis": {
33+
"adinify": "{{ adinify.response_time_ms }}"
34+
},
35+
"prebid": {
36+
"auctiontimestamp": 0
37+
},
38+
"tmaxrequest": 5000
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
@@ -427,6 +427,8 @@ adapters.smarthub.aliases.vimayx.enabled=true
427427
adapters.smarthub.aliases.vimayx.endpoint=http://localhost:8090/vimayx-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}}
428428
adapters.smarthub.aliases.felixads.enabled=true
429429
adapters.smarthub.aliases.felixads.endpoint=http://localhost:8090/felixads-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}}
430+
adapters.smarthub.aliases.adinify.enabled=true
431+
adapters.smarthub.aliases.adinify.endpoint=http://localhost:8090/adinify-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}}
430432
adapters.smarthub.aliases.artechnology.enabled=true
431433
adapters.smarthub.aliases.artechnology.endpoint=http://localhost:8090/artechnology-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}}
432434
adapters.smartyads.enabled=true

0 commit comments

Comments
 (0)