forked from prebid/prebid-server-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmileWantedTest.java
More file actions
34 lines (27 loc) · 1.4 KB
/
Copy pathSmileWantedTest.java
File metadata and controls
34 lines (27 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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 SmileWantedTest extends IntegrationTest {
@Test
public void openrtb2AuctionShouldRespondWithBidsFromSmileWanted() throws IOException, JSONException {
// given
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/smilewanted-exchange/java/someZoneId"))
.withRequestBody(equalToJson(jsonFrom("openrtb2/smilewanted/test-smilewanted-bid-request.json")))
.willReturn(aResponse().withBody(jsonFrom(
"openrtb2/smilewanted/test-smilewanted-bid-response.json"))));
// when
final Response response = responseFor("openrtb2/smilewanted/test-auction-smilewanted-request.json",
Endpoint.openrtb2_auction);
// then
assertJsonEquals("openrtb2/smilewanted/test-auction-smilewanted-response.json", response,
singletonList("smilewanted"));
}
}