Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ public class ExtImpFreewheelSSP {

@JsonProperty("zoneId")
String zoneId;

String customSiteSectionId;

String networkId;

String profileId;
}
5 changes: 5 additions & 0 deletions src/main/resources/bidder-config/freewheelssp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ adapters:
endpoint: https://ads.stickyadstv.com/openrtb/dsp
ortb-version: "2.6"
modifying-vast-xml-allowed: true
aliases:
fwssp:
enabled: false
endpoint: "https://prebid.v.fwmrm.net/ortb/ssp"
endpoint-compression: gzip
meta-info:
maintainer-email: prebid-maintainer@freewheel.com
app-media-types:
Expand Down
25 changes: 25 additions & 0 deletions src/main/resources/static/bidder-params/fwssp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "FWSSP Adapter Params",
"description": "A schema which validates params accepted by the FWSSP adapter",
"type": "object",
"properties": {
"custom_site_section_id": {
"type": "string",
"description": "custom Site Section tag (e.g. ss_12345) or numeric Site Section ID (e.g. 12345)"
},
"network_id": {
"type": "string",
"description": "Network ID (e.g. 12345)"
},
"profile_id": {
"type": "string",
"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)"
}
},
"required": [
"custom_site_section_id",
"network_id",
"profile_id"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,16 @@ public void makeHttpRequestsShouldModifyImps() {
final Result<List<HttpRequest<BidRequest>>> result = target.makeHttpRequests(bidRequest);

// then
final Map<String, String> expectedImpExt = Map.of(
"zoneId", "zoneId",
"custom_site_section_id", "customSiteSectionId",
"network_id", "networkId",
"profile_id", "profileId");
assertThat(result.getValue())
.extracting(HttpRequest::getPayload)
.flatExtracting(BidRequest::getImp)
.extracting(Imp::getExt)
.containsExactly(
mapper.valueToTree(Map.of("zoneId", "1")),
mapper.valueToTree(Map.of("zoneId", "1")));
.containsExactly(mapper.valueToTree(expectedImpExt), mapper.valueToTree(expectedImpExt));
assertThat(result.getErrors()).isEmpty();
}

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

Expand Down
35 changes: 35 additions & 0 deletions src/test/java/org/prebid/server/it/FwsspTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package org.prebid.server.it;

import io.restassured.response.Response;
import org.json.JSONException;
import org.junit.jupiter.api.Test;
import org.prebid.server.model.Endpoint;

import java.io.IOException;

import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static java.util.Collections.singletonList;

public class FwsspTest extends IntegrationTest {

@Test
public void openrtb2AuctionShouldRespondWithBidsFromFwssp() throws IOException, JSONException {
// given
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/fwssp-exchange"))
.withRequestBody(equalToJson(
jsonFrom("openrtb2/fwssp/test-fwssp-bid-request.json")))
.willReturn(aResponse().withBody(
jsonFrom("openrtb2/fwssp/test-fwssp-bid-response.json"))));

// when
final Response response = responseFor("openrtb2/fwssp/test-auction-fwssp-request.json",
Endpoint.openrtb2_auction);

// then
assertJsonEquals("openrtb2/fwssp/test-auction-fwssp-response.json", response,
singletonList("fwssp"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"id": "request_id",
"imp": [
{
"id": "imp-1",
"video": {
"mimes": ["video/mp4"],
"w": 300,
"h": 250
},
"ext": {
"fwssp": {
"profile_id": "123",
"network_id": "456",
"custom_site_section_id": "789"
}
}
}
],
"tmax": 5000,
"cur": [
"USD"
],
"regs": {
"ext": {
"gdpr": 0
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "12345_fwssp-test_1",
"impid": "imp-1",
"exp": 1500,
"price": 1.0,
"adid": "7857",
"adm": "<?xml version='1.0' encoding='UTF-8'?><VAST version='2.0'></VAST>",
"cid": "4001",
"crid": "7857",
"ext": {
"prebid": {
"type": "video",
"meta": {
"adaptercode": "fwssp"
}
},
"origbidcpm": 1
}
}
],
"seat": "fwssp",
"group": 0
}
],
"cur": "USD",
"ext": {
"responsetimemillis": {
"fwssp": "{{ fwssp.response_time_ms }}"
},
"prebid": {
"auctiontimestamp": 0
},
"tmaxrequest": 5000
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"id": "request_id",
"imp": [
{
"id": "imp-1",
"video": {
"mimes": [
"video/mp4"
],
"w": 300,
"h": 250
},
"secure": 1,
"ext": {
"profile_id": "123",
"network_id": "456",
"custom_site_section_id": "789"
}
}
],
"source": {
"tid": "${json-unit.any-string}"
},
"site": {
"domain": "www.example.com",
"page": "http://www.example.com",
"publisher": {
"domain": "example.com"
},
"ext": {
"amp": 0
}
},
"device": {
"ua": "userAgent",
"ip": "193.168.244.1"
},
"at": 1,
"tmax": "${json-unit.any-number}",
"cur": [
"USD"
],
"regs" : {
"gdpr" : 0
},
"ext": {
"prebid": {
"server": {
"externalurl": "http://localhost:8080",
"gvlid": 1,
"datacenter": "local",
"endpoint": "/openrtb2/auction"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "12345_fwssp-test_1",
"impid": "imp-1",
"price": 1.0,
"adid": "7857",
"adm": "<?xml version='1.0' encoding='UTF-8'?><VAST version='2.0'></VAST>",
"cid": "4001",
"crid": "7857"
}
],
"type": "video"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ adapters.audiencenetwork.platform-id=101
adapters.audiencenetwork.app-secret=67234
adapters.freewheelssp.enabled=true
adapters.freewheelssp.endpoint=http://localhost:8090/freewheelssp-exchange
adapters.freewheelssp.aliases.fwssp.enabled=true
adapters.freewheelssp.aliases.fwssp.endpoint=http://localhost:8090/fwssp-exchange
adapters.frvradn.enabled=true
adapters.frvradn.endpoint=http://localhost:8090/frvradn-exchange
adapters.gamma.enabled=true
Expand Down
Loading