new BasicHeader("Set-Cookie", "cookie_name=cookie_value")
});
when(httpClientResponse.getEntity()).thenReturn(new StringEntity("some_other_body"));
// when
HttpResponse httpResponse = new ApacheHttpClientToMockServerResponseMapper().mapApacheHttpClientResponseToMockServerResponse(httpClientResponse, false);
// then
assertEquals(httpResponse.getStatusCode(), new Integer(500));
assertThat(httpResponse.getHeaders(), containsInAnyOrder(
new Header("header_name", "header_value"),
new Header("Set-Cookie", "cookie_name=cookie_value")
));
assertEquals(httpResponse.getCookies(), Arrays.asList(
new Cookie("cookie_name", "cookie_value")
));
assertEquals(httpResponse.getBodyAsString(), "some_other_body");
}