assertEquals(new HashSet<String>(Arrays.asList(HttpHeaders.CONTENT_TYPE)), response.getHeaderNames());
}
@Test
public void completeResponse() {
final ODataResponse response = ODataResponse.newBuilder()
.status(HttpStatusCodes.OK)
.header("def", "456")
.eTag("x")
.contentHeader(HttpContentType.TEXT_PLAIN)
.idLiteral("id")
.entity("body")
.build();
assertEquals(HttpStatusCodes.OK, response.getStatus());
assertEquals("456", response.getHeader("def"));
assertEquals("x", response.getETag());
assertEquals(HttpContentType.TEXT_PLAIN, response.getContentHeader());
assertEquals("id", response.getIdLiteral());
assertEquals(4, response.getHeaderNames().size());
assertEquals("body", response.getEntity());
final ODataResponse responseCopy = ODataResponse.fromResponse(response).build();
assertEquals(HttpStatusCodes.OK, responseCopy.getStatus());
assertEquals("456", responseCopy.getHeader("def"));
assertEquals("x", responseCopy.getETag());
assertEquals(HttpContentType.TEXT_PLAIN, response.getContentHeader());
assertEquals("id", responseCopy.getIdLiteral());
assertEquals("body", responseCopy.getEntity());
}