Skip to content

Commit 78dc73d

Browse files
New Adapter: MyCodeMedia - Teqblaze alias (#4471)
1 parent e8dc963 commit 78dc73d

7 files changed

Lines changed: 192 additions & 0 deletions

File tree

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,22 @@ adapters:
114114
meta-info:
115115
maintainer-email: adtech@markappmedia.site
116116
vendor-id: 1406
117+
mycodemedia:
118+
enabled: false
119+
endpoint: https://east-backend.mycodemedia.com/pserver
120+
meta-info:
121+
maintainer-email: support-platform@mycodemedia.com
122+
usersync:
123+
enabled: true
124+
cookie-family-name: mycodemedia
125+
iframe:
126+
url: https://usersync.mycodemedia.com/pbserverIframe?gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}}&pbserverUrl={{redirect_url}}
127+
support-cors: false
128+
uid-macro: '[UID]'
129+
redirect:
130+
url: https://usersync.mycodemedia.com/pbserver?gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}}&redir={{redirect_url}}
131+
support-cors: false
132+
uid-macro: '[UID]'
117133
meta-info:
118134
maintainer-email: github@teqblaze.com
119135
app-media-types:
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+
import java.util.List;
10+
11+
import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
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+
16+
public class MycodemediaTest extends IntegrationTest {
17+
18+
@Test
19+
public void openrtb2AuctionShouldRespondWithBidsFromMycodemedia() throws IOException, JSONException {
20+
// given
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/mycodemedia-exchange/"))
22+
.withRequestBody(equalToJson(jsonFrom("openrtb2/mycodemedia/test-mycodemedia-bid-request.json")))
23+
.willReturn(aResponse().withBody(jsonFrom("openrtb2/mycodemedia/test-mycodemedia-bid-response.json"))));
24+
25+
// when
26+
final Response response = responseFor(
27+
"openrtb2/mycodemedia/test-auction-mycodemedia-request.json",
28+
Endpoint.openrtb2_auction
29+
);
30+
31+
// then
32+
assertJsonEquals("openrtb2/mycodemedia/test-auction-mycodemedia-response.json",
33+
response, List.of("mycodemedia"));
34+
}
35+
36+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": "request_id",
3+
"imp": [
4+
{
5+
"id": "imp_id",
6+
"banner": {
7+
"w": 300,
8+
"h": 250
9+
},
10+
"ext": {
11+
"mycodemedia": {
12+
"placementId": "testPlacementId"
13+
}
14+
}
15+
}
16+
],
17+
"tmax": 5000,
18+
"regs": {
19+
"ext": {
20+
"gdpr": 0
21+
}
22+
}
23+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"exp": 300,
10+
"price": 3.33,
11+
"crid": "creativeId",
12+
"mtype": 1,
13+
"ext": {
14+
"origbidcpm": 3.33,
15+
"prebid": {
16+
"type": "banner",
17+
"meta": {
18+
"adaptercode": "mycodemedia"
19+
}
20+
}
21+
}
22+
}
23+
],
24+
"seat": "mycodemedia",
25+
"group": 0
26+
}
27+
],
28+
"cur": "USD",
29+
"ext": {
30+
"responsetimemillis": {
31+
"mycodemedia": "{{ mycodemedia.response_time_ms }}"
32+
},
33+
"prebid": {
34+
"auctiontimestamp": 0
35+
},
36+
"tmaxrequest": 5000
37+
}
38+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"id": "request_id",
3+
"imp": [
4+
{
5+
"id": "imp_id",
6+
"banner": {
7+
"w": 300,
8+
"h": 250
9+
},
10+
"secure": 1,
11+
"ext": {
12+
"bidder": {
13+
"type": "publisher",
14+
"placementId": "testPlacementId"
15+
}
16+
}
17+
}
18+
],
19+
"site": {
20+
"domain": "www.example.com",
21+
"page": "http://www.example.com",
22+
"publisher": {
23+
"domain": "example.com"
24+
},
25+
"ext": {
26+
"amp": 0
27+
}
28+
},
29+
"device": {
30+
"ua": "userAgent",
31+
"ip": "193.168.244.1"
32+
},
33+
"at": 1,
34+
"tmax": "${json-unit.any-number}",
35+
"cur": [
36+
"USD"
37+
],
38+
"source": {
39+
"tid": "${json-unit.any-string}"
40+
},
41+
"regs": {
42+
"ext": {
43+
"gdpr": 0
44+
}
45+
},
46+
"ext": {
47+
"prebid": {
48+
"server": {
49+
"externalurl": "http://localhost:8080",
50+
"gvlid": 1,
51+
"datacenter": "local",
52+
"endpoint": "/openrtb2/auction"
53+
}
54+
}
55+
}
56+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "bid_id",
8+
"impid": "imp_id",
9+
"price": 3.33,
10+
"crid": "creativeId",
11+
"mtype": 1,
12+
"ext": {
13+
"prebid": {
14+
"type": "banner"
15+
}
16+
}
17+
}
18+
]
19+
}
20+
]
21+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@ adapters.teqblaze.aliases.progx.enabled=true
599599
adapters.teqblaze.aliases.progx.endpoint=http://localhost:8090/progx-exchange/
600600
adapters.teqblaze.aliases.harion.enabled=true
601601
adapters.teqblaze.aliases.harion.endpoint=http://localhost:8090/harion-exchange/
602+
adapters.teqblaze.aliases.mycodemedia.enabled=true
603+
adapters.teqblaze.aliases.mycodemedia.endpoint=http://localhost:8090/mycodemedia-exchange/
602604
adapters.theadx.enabled=true
603605
adapters.theadx.endpoint=http://localhost:8090/theadx-exchange
604606
adapters.tradplus.enabled=true

0 commit comments

Comments
 (0)