Skip to content

Commit 4fe45e8

Browse files
New Adapter: Bidfuse (#4370)
1 parent a35ff7e commit 4fe45e8

7 files changed

Lines changed: 189 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
@@ -43,6 +43,22 @@ adapters:
4343
mata-info:
4444
maintainer-email: support@gravite.net
4545
vendor-id: 377
46+
bidfuse:
47+
enabled: false
48+
endpoint: https://bn.bidfuse.com/pserver
49+
meta-info:
50+
maintainer-email: support@bidfuse.com
51+
usersync:
52+
enabled: true
53+
cookie-family-name: bidfuse
54+
redirect:
55+
url: https://syncbf.bidfuse.com/pbserver?gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&ccpa={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}}&redir={{redirect_url}}
56+
support-cors: false
57+
uid-macro: '[UID]'
58+
iframe:
59+
url: https://syncbf.bidfuse.com/pbserverIframe?gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&ccpa={{us_privacy}}&gpp={{gpp}}&gpp_sid={{gpp_sid}}&pbserverUrl={{redirect_url}}
60+
support-cors: false
61+
uid-macro: '[UID]'
4662
adsinteractive:
4763
enabled: false
4864
endpoint: https://bntb.adsinteractive.com/pserver
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 BidfuseTest extends IntegrationTest {
17+
18+
@Test
19+
public void openrtb2AuctionShouldRespondWithBidsFromBidfuse() throws IOException, JSONException {
20+
// given
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/bidfuse-exchange"))
22+
.withRequestBody(equalToJson(jsonFrom("openrtb2/bidfuse/test-bidfuse-bid-request.json")))
23+
.willReturn(aResponse().withBody(jsonFrom("openrtb2/bidfuse/test-bidfuse-bid-response.json"))));
24+
25+
// when
26+
final Response response = responseFor("openrtb2/bidfuse/test-auction-bidfuse-request.json",
27+
Endpoint.openrtb2_auction);
28+
29+
// then
30+
assertJsonEquals(
31+
"openrtb2/bidfuse/test-auction-bidfuse-response.json", response, singletonList("bidfuse"));
32+
}
33+
}
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+
"bidfuse": {
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": "bidfuse"
19+
}
20+
}
21+
}
22+
}
23+
],
24+
"seat": "bidfuse",
25+
"group": 0
26+
}
27+
],
28+
"cur": "USD",
29+
"ext": {
30+
"responsetimemillis": {
31+
"bidfuse": "{{ bidfuse.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
@@ -585,6 +585,8 @@ adapters.teqblaze.aliases.appStockSSP.enabled=true
585585
adapters.teqblaze.aliases.appStockSSP.endpoint=http://localhost:8090/appstockssp-exchange
586586
adapters.teqblaze.aliases.gravite.enabled=true
587587
adapters.teqblaze.aliases.gravite.endpoint=http://localhost:8090/gravite-exchange
588+
adapters.teqblaze.aliases.bidfuse.enabled=true
589+
adapters.teqblaze.aliases.bidfuse.endpoint=http://localhost:8090/bidfuse-exchange
588590
adapters.teqblaze.aliases.adsinteractive.enabled=true
589591
adapters.teqblaze.aliases.adsinteractive.endpoint=http://localhost:8090/adsinteractive-exchange
590592
adapters.teqblaze.aliases.progx.enabled=true

0 commit comments

Comments
 (0)