Skip to content

Commit 14fe866

Browse files
Addigi: New alias for Smarthub (#3848)
1 parent d7267e5 commit 14fe866

7 files changed

Lines changed: 183 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ adapters:
2626
artechnology:
2727
enabled: false
2828
endpoint: https://artechnology-prebid.attekmi.com/pbserver/?seat={{AccountID}}&token={{SourceId}}
29+
addigi:
30+
enabled: false
31+
endpoint: https://addigi-prebid.attekmi.com/pbserver/?seat={{AccountID}}&token={{SourceId}}
2932
meta-info:
3033
maintainer-email: prebid@attekmi.com
3134
app-media-types:
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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 AddigiTest extends IntegrationTest {
17+
18+
@Test
19+
public void openrtb2AuctionShouldRespondWithBidsFromAddigi() throws IOException, JSONException {
20+
//given
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/addigi-exchange"))
22+
.withRequestBody(equalToJson(jsonFrom("openrtb2/addigi/test-addigi-bid-request.json")))
23+
.willReturn(aResponse().withBody(jsonFrom("openrtb2/addigi/test-addigi-bid-response.json"))));
24+
25+
//when
26+
final Response response = responseFor("openrtb2/addigi/test-auction-addigi-request.json",
27+
Endpoint.openrtb2_auction);
28+
29+
//then
30+
assertJsonEquals("openrtb2/addigi/test-auction-addigi-response.json", response, singletonList("addigi"));
31+
}
32+
}
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+
"addigi": {
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": "addigi",
27+
"group": 0
28+
}
29+
],
30+
"cur": "USD",
31+
"ext": {
32+
"responsetimemillis": {
33+
"addigi": "{{ addigi.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
@@ -461,6 +461,8 @@ adapters.smarthub.aliases.jambojar.enabled=true
461461
adapters.smarthub.aliases.jambojar.endpoint=http://localhost:8090/jambojar-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}}
462462
adapters.smarthub.aliases.adinify.enabled=true
463463
adapters.smarthub.aliases.adinify.endpoint=http://localhost:8090/adinify-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}}
464+
adapters.smarthub.aliases.addigi.enabled=true
465+
adapters.smarthub.aliases.addigi.endpoint=http://localhost:8090/addigi-exchange
464466
adapters.smarthub.aliases.artechnology.enabled=true
465467
adapters.smarthub.aliases.artechnology.endpoint=http://localhost:8090/artechnology-exchange?host={{Host}}&accountId={{AccountID}}&sourceId={{SourceId}}
466468
adapters.smartyads.enabled=true

0 commit comments

Comments
 (0)