-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
a52f2df
commit 1f49d7f
Showing
7 changed files
with
193 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/test/resources/org/prebid/server/it/openrtb2/blue/test-auction-blue-request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/test/resources/org/prebid/server/it/openrtb2/blue/test-auction-blue-response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
src/test/resources/org/prebid/server/it/openrtb2/blue/test-blue-bid-request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/test/resources/org/prebid/server/it/openrtb2/blue/test-blue-bid-response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters