Skip to content

Commit 2d2d339

Browse files
FreewheelSSP: new alias fwssp (#4019)
1 parent 7c646d9 commit 2d2d339

10 files changed

Lines changed: 225 additions & 4 deletions

File tree

src/main/java/org/prebid/server/proto/openrtb/ext/request/freewheelssp/ExtImpFreewheelSSP.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@ public class ExtImpFreewheelSSP {
88

99
@JsonProperty("zoneId")
1010
String zoneId;
11+
12+
String customSiteSectionId;
13+
14+
String networkId;
15+
16+
String profileId;
1117
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ adapters:
33
endpoint: https://ads.stickyadstv.com/openrtb/dsp
44
ortb-version: "2.6"
55
modifying-vast-xml-allowed: true
6+
aliases:
7+
fwssp:
8+
enabled: false
9+
endpoint: "https://prebid.v.fwmrm.net/ortb/ssp"
10+
endpoint-compression: gzip
611
meta-info:
712
maintainer-email: prebid-maintainer@freewheel.com
813
app-media-types:
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "FWSSP Adapter Params",
4+
"description": "A schema which validates params accepted by the FWSSP adapter",
5+
"type": "object",
6+
"properties": {
7+
"custom_site_section_id": {
8+
"type": "string",
9+
"description": "custom Site Section tag (e.g. ss_12345) or numeric Site Section ID (e.g. 12345)"
10+
},
11+
"network_id": {
12+
"type": "string",
13+
"description": "Network ID (e.g. 12345)"
14+
},
15+
"profile_id": {
16+
"type": "string",
17+
"description": "The value should contain a profile name. and NOT a numeric profile ID. This can either include the network ID prefix (e.g. 123456:profile_name_xyz123) or with the profile name alone (e.g. profile_name_xyz123)"
18+
}
19+
},
20+
"required": [
21+
"custom_site_section_id",
22+
"network_id",
23+
"profile_id"
24+
]
25+
}

src/test/java/org/prebid/server/bidder/freewheelssp/FreewheelSSPBidderTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,16 @@ public void makeHttpRequestsShouldModifyImps() {
7373
final Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);
7474

7575
// then
76+
final Map<String, String> expectedImpExt = Map.of(
77+
"zoneId", "zoneId",
78+
"custom_site_section_id", "customSiteSectionId",
79+
"network_id", "networkId",
80+
"profile_id", "profileId");
7681
assertThat(result.getValue())
7782
.extracting(HttpRequest::getPayload)
7883
.flatExtracting(BidRequest::getImp)
7984
.extracting(Imp::getExt)
80-
.containsExactly(
81-
mapper.valueToTree(Map.of("zoneId", "1")),
82-
mapper.valueToTree(Map.of("zoneId", "1")));
85+
.containsExactly(mapper.valueToTree(expectedImpExt), mapper.valueToTree(expectedImpExt));
8386
assertThat(result.getErrors()).isEmpty();
8487
}
8588

@@ -197,7 +200,8 @@ private static BidRequest givenBidRequest(Imp... imps) {
197200
private static Imp givenImp(UnaryOperator<Imp.ImpBuilder> impCustomizer) {
198201
return impCustomizer.apply(Imp.builder()
199202
.id("123")
200-
.ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpFreewheelSSP.of("1")))))
203+
.ext(mapper.valueToTree(ExtPrebid.of(null, ExtImpFreewheelSSP.of(
204+
"zoneId", "customSiteSectionId", "networkId", "profileId")))))
201205
.build();
202206
}
203207

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 FwsspTest extends IntegrationTest {
17+
18+
@Test
19+
public void openrtb2AuctionShouldRespondWithBidsFromFwssp() throws IOException, JSONException {
20+
// given
21+
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/fwssp-exchange"))
22+
.withRequestBody(equalToJson(
23+
jsonFrom("openrtb2/fwssp/test-fwssp-bid-request.json")))
24+
.willReturn(aResponse().withBody(
25+
jsonFrom("openrtb2/fwssp/test-fwssp-bid-response.json"))));
26+
27+
// when
28+
final Response response = responseFor("openrtb2/fwssp/test-auction-fwssp-request.json",
29+
Endpoint.openrtb2_auction);
30+
31+
// then
32+
assertJsonEquals("openrtb2/fwssp/test-auction-fwssp-response.json", response,
33+
singletonList("fwssp"));
34+
}
35+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"id": "request_id",
3+
"imp": [
4+
{
5+
"id": "imp-1",
6+
"video": {
7+
"mimes": ["video/mp4"],
8+
"w": 300,
9+
"h": 250
10+
},
11+
"ext": {
12+
"fwssp": {
13+
"profile_id": "123",
14+
"network_id": "456",
15+
"custom_site_section_id": "789"
16+
}
17+
}
18+
}
19+
],
20+
"tmax": 5000,
21+
"cur": [
22+
"USD"
23+
],
24+
"regs": {
25+
"ext": {
26+
"gdpr": 0
27+
}
28+
}
29+
}
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": "12345_fwssp-test_1",
8+
"impid": "imp-1",
9+
"exp": 1500,
10+
"price": 1.0,
11+
"adid": "7857",
12+
"adm": "<?xml version='1.0' encoding='UTF-8'?><VAST version='2.0'></VAST>",
13+
"cid": "4001",
14+
"crid": "7857",
15+
"ext": {
16+
"prebid": {
17+
"type": "video",
18+
"meta": {
19+
"adaptercode": "fwssp"
20+
}
21+
},
22+
"origbidcpm": 1
23+
}
24+
}
25+
],
26+
"seat": "fwssp",
27+
"group": 0
28+
}
29+
],
30+
"cur": "USD",
31+
"ext": {
32+
"responsetimemillis": {
33+
"fwssp": "{{ fwssp.response_time_ms }}"
34+
},
35+
"prebid": {
36+
"auctiontimestamp": 0
37+
},
38+
"tmaxrequest": 5000
39+
}
40+
}
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-1",
6+
"video": {
7+
"mimes": [
8+
"video/mp4"
9+
],
10+
"w": 300,
11+
"h": 250
12+
},
13+
"secure": 1,
14+
"ext": {
15+
"profile_id": "123",
16+
"network_id": "456",
17+
"custom_site_section_id": "789"
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+
"gdpr" : 0
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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"id": "request_id",
3+
"seatbid": [
4+
{
5+
"bid": [
6+
{
7+
"id": "12345_fwssp-test_1",
8+
"impid": "imp-1",
9+
"price": 1.0,
10+
"adid": "7857",
11+
"adm": "<?xml version='1.0' encoding='UTF-8'?><VAST version='2.0'></VAST>",
12+
"cid": "4001",
13+
"crid": "7857"
14+
}
15+
],
16+
"type": "video"
17+
}
18+
]
19+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ adapters.audiencenetwork.platform-id=101
236236
adapters.audiencenetwork.app-secret=67234
237237
adapters.freewheelssp.enabled=true
238238
adapters.freewheelssp.endpoint=http://localhost:8090/freewheelssp-exchange
239+
adapters.freewheelssp.aliases.fwssp.enabled=true
240+
adapters.freewheelssp.aliases.fwssp.endpoint=http://localhost:8090/fwssp-exchange
239241
adapters.frvradn.enabled=true
240242
adapters.frvradn.endpoint=http://localhost:8090/frvradn-exchange
241243
adapters.gamma.enabled=true

0 commit comments

Comments
 (0)