-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add-pgamssp-bidder
- Loading branch information
Showing
13 changed files
with
165 additions
and
10 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
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
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
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
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
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
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
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,38 @@ | ||
package org.prebid.server.it; | ||
|
||
import io.restassured.response.Response; | ||
import org.json.JSONException; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.prebid.server.model.Endpoint; | ||
import org.springframework.test.context.junit4.SpringRunner; | ||
|
||
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; | ||
|
||
@RunWith(SpringRunner.class) | ||
public class GreedyGameTest extends IntegrationTest { | ||
|
||
@Test | ||
public void openrtb2AuctionShouldRespondWithBidsFromTheGreedyGameBidder() throws IOException, JSONException { | ||
// given | ||
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/greedygame-exchange/test.host/123456")) | ||
.withRequestBody(equalToJson( | ||
jsonFrom("openrtb2/greedygame/test-greedygame-bid-request.json"))) | ||
.willReturn(aResponse().withBody( | ||
jsonFrom("openrtb2/greedygame/test-greedygame-bid-response.json")))); | ||
|
||
// when | ||
final Response response = responseFor("openrtb2/greedygame/test-auction-greedygame-request.json", | ||
Endpoint.openrtb2_auction); | ||
|
||
// then | ||
assertJsonEquals("openrtb2/greedygame/test-auction-greedygame-response.json", response, | ||
singletonList("greedygame")); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...t/resources/org/prebid/server/it/openrtb2/greedygame/test-auction-greedygame-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": { | ||
"greedygame": { | ||
"host": "test.host", | ||
"publisherId": "123456" | ||
} | ||
} | ||
} | ||
], | ||
"tmax": 5000, | ||
"regs": { | ||
"ext": { | ||
"gdpr": 0 | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
.../resources/org/prebid/server/it/openrtb2/greedygame/test-auction-greedygame-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,33 @@ | ||
{ | ||
"id": "request_id", | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "bid_id", | ||
"impid": "imp_id", | ||
"price": 3.33, | ||
"crid": "creativeId", | ||
"ext": { | ||
"origbidcpm": 3.33, | ||
"prebid": { | ||
"type": "banner" | ||
} | ||
} | ||
} | ||
], | ||
"seat": "greedygame", | ||
"group": 0 | ||
} | ||
], | ||
"cur": "USD", | ||
"ext": { | ||
"responsetimemillis": { | ||
"greedygame": "{{ greedygame.response_time_ms }}" | ||
}, | ||
"prebid": { | ||
"auctiontimestamp": 0 | ||
}, | ||
"tmaxrequest": 5000 | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/test/resources/org/prebid/server/it/openrtb2/greedygame/test-greedygame-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,40 @@ | ||
{ | ||
"id": "request_id-imp_id", | ||
"imp": [ | ||
{ | ||
"id": "imp_id", | ||
"secure": 1, | ||
"banner": { | ||
"w": 300, | ||
"h": 250 | ||
} | ||
} | ||
], | ||
"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 | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...test/resources/org/prebid/server/it/openrtb2/greedygame/test-greedygame-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,15 @@ | ||
{ | ||
"id": "request_id", | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "bid_id", | ||
"impid": "imp_id", | ||
"price": 3.33, | ||
"crid": "creativeId" | ||
} | ||
] | ||
} | ||
] | ||
} |
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