use of io.apiman.test.policies.Configuration in project apiman-plugins by apiman.
the class TransformationPolicyTest method keepServerJsonResponseAsJson.
@Test
@Configuration("{\"clientFormat\": \"JSON\", \"serverFormat\": \"JSON\"}")
@BackEndApi(ProduceJsonBackEndApi.class)
public void keepServerJsonResponseAsJson() throws Throwable {
PolicyTestRequest request = PolicyTestRequest.build(PolicyTestRequestType.GET, "/some/resource");
PolicyTestResponse response = send(request);
String expectedResponse = "{\"name\":\"apiman\"}";
assertEquals("application/json", response.header("Content-Type"));
assertEquals(String.valueOf(expectedResponse.getBytes("UTF-8").length), response.header("Content-Length"));
assertEquals(expectedResponse, response.body());
}
Aggregations