Skip to content

Commit

Permalink
Blue: Add placementId bidder param #3609 (#3733)
Browse files Browse the repository at this point in the history
  • Loading branch information
przemkaczmarek authored Feb 14, 2025
1 parent a52f2df commit 1f49d7f
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/resources/static/bidder-params/blue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Blue Adapter Params",
"description": "A schema which validates params accepted by the Blue adapter",
"type": "object",
"properties": {
"placementId": {
"type": "string",
"description": "Placement ID provided by Blue"
},
"publisherId": {
"type": "string",
"description": "The publisher’s ID provided by Blue"
}
},
"required": [
"publisherId"
]
}
32 changes: 32 additions & 0 deletions src/test/java/org/prebid/server/it/BlueTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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 BlueTest extends IntegrationTest {

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

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

// then
assertJsonEquals("openrtb2/blue/test-auction-blue-response.json", response, singletonList("blue"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"banner": {
"w": 300,
"h": 250
},
"ext": {
"blue": {
"publisherId": "testPublisherId",
"placementId": "testPlacementId"
}
}
}
],
"tmax": 5000,
"regs": {
"ext": {
"gdpr": 0
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "bid_id",
"impid": "imp_id",
"exp": 300,
"price": 3.33,
"adm": "adm001",
"adid": "adid001",
"cid": "cid001",
"crid": "crid001",
"w": 300,
"h": 250,
"ext": {
"prebid": {
"type": "banner"
},
"origbidcpm": 3.33
}
}
],
"seat": "blue",
"group": 0
}
],
"cur": "USD",
"ext": {
"responsetimemillis": {
"blue": 0
},
"prebid": {
"auctiontimestamp": 0
},
"tmaxrequest": 5000
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"id": "request_id",
"imp": [
{
"id": "imp_id",
"banner": {
"w": 300,
"h": 250
},
"secure": 1,
"ext": {
"tid": "${json-unit.any-string}",
"bidder": {
"publisherId": "testPublisherId",
"placementId": "testPlacementId"
}
}
}
],
"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": {
"ext": {
"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,20 @@
{
"id": "request_id",
"seatbid": [
{
"bid": [
{
"id": "bid_id",
"impid": "imp_id",
"price": 3.33,
"adid": "adid001",
"crid": "crid001",
"cid": "cid001",
"adm": "adm001",
"h": 250,
"w": 300
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ adapters.generic.aliases.nativo.enabled=true
adapters.generic.aliases.nativo.endpoint=http://localhost:8090/nativo-exchange
adapters.generic.aliases.adrino.enabled=true
adapters.generic.aliases.adrino.endpoint=http://localhost:8090/adrino-exchange
adapters.generic.aliases.blue.enabled=true
adapters.generic.aliases.blue.endpoint=http://localhost:8090/blue-exchange
adapters.generic.aliases.ccx.enabled=true
adapters.generic.aliases.ccx.endpoint=http://localhost:8090/ccx-exchange
adapters.generic.aliases.cwire.enabled=true
Expand Down

0 comments on commit 1f49d7f

Please sign in to comment.