forked from prebid/prebid-server-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMobilefuseTest.java
More file actions
33 lines (26 loc) · 1.35 KB
/
Copy pathMobilefuseTest.java
File metadata and controls
33 lines (26 loc) · 1.35 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
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 MobilefuseTest extends IntegrationTest {
@Test
public void openrtb2AuctionShouldRespondWithBidsFromMobilefuse() throws IOException, JSONException {
// given
WIRE_MOCK_RULE.stubFor(post(urlPathEqualTo("/mobilefuse-exchange/"))
.withRequestBody(equalToJson(jsonFrom("openrtb2/mobilefuse/test-mobilefuse-bid-request.json")))
.willReturn(aResponse().withBody(jsonFrom("openrtb2/mobilefuse/test-mobilefuse-bid-response.json"))));
// when
final Response response = responseFor("openrtb2/mobilefuse/test-auction-mobilefuse-request.json",
Endpoint.openrtb2_auction);
// then
assertJsonEquals("openrtb2/mobilefuse/test-auction-mobilefuse-response.json", response,
singletonList("mobilefuse"));
}
}