@Test public void testHeadDoesNotSetAutomaticallySetContentLengthHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.HEAD, 200, MultiMap.caseInsensitiveMultiMap()); assertNull(respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testResetContentSetsContentLengthHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 205, MultiMap.caseInsensitiveMultiMap()); assertEquals("0", respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testNotModifiedDoesNotSetAutomaticallySetContentLengthHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 304, MultiMap.caseInsensitiveMultiMap()); assertNull(respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void test1xxRemovesContentLengthHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 102, MultiMap.caseInsensitiveMultiMap().set("content-length", "34")); assertNull(respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testHeadRemovesTransferEncodingHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.HEAD, 200, MultiMap.caseInsensitiveMultiMap().set("transfer-encoding", "chunked")); assertNull(respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testNoContentRemovesContentLengthHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 204, MultiMap.caseInsensitiveMultiMap().set("content-length", "34")); assertNull(respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testNoContentRemovesTransferEncodingHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 204, MultiMap.caseInsensitiveMultiMap().set("transfer-encoding", "chunked")); assertNull(respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testNotModifiedRemovesTransferEncodingHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 304, MultiMap.caseInsensitiveMultiMap().set("transfer-encoding", "chunked")); assertNull(respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testResetContentRemovesTransferEncodingHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 205, MultiMap.caseInsensitiveMultiMap().set("transfer-encoding", "chunked")); assertEquals("0", respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testHeadAllowsContentLengthHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.HEAD, 200, MultiMap.caseInsensitiveMultiMap().set("content-length", "34")); assertEquals("34", respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testNotModifiedAllowsContentLengthHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 304, MultiMap.caseInsensitiveMultiMap().set("content-length", "34")); assertEquals("34", respHeaders.get("Content-Length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void test1xxRemovesTransferEncodingHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 102, MultiMap.caseInsensitiveMultiMap().set("transfer-encoding", "chunked")); assertNull(respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testResetContentSetsContentLengthHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 205, MultiMap.caseInsensitiveMultiMap()); assertEquals("0", respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testNotModifiedDoesNotSetAutomaticallySetContentLengthHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 304, MultiMap.caseInsensitiveMultiMap()); assertNull(respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testHeadAllowsContentLengthHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.HEAD, 200, MultiMap.caseInsensitiveMultiMap().set("content-length", "34")); assertEquals("34", respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testHeadRemovesTransferEncodingHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.HEAD, 200, MultiMap.caseInsensitiveMultiMap().set("transfer-encoding", "chunked")); assertNull(respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testNoContentRemovesContentLengthHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 204, MultiMap.caseInsensitiveMultiMap().set("content-length", "34")); assertNull(respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testResetContentRemovesTransferEncodingHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 205, MultiMap.caseInsensitiveMultiMap().set("transfer-encoding", "chunked")); assertEquals("0", respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testNotModifiedAllowsContentLengthHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 304, MultiMap.caseInsensitiveMultiMap().set("content-length", "34")); assertEquals("34", respHeaders.get("Content-Length")); assertNull(respHeaders.get("transfer-encoding")); }
@Test public void testNotModifiedRemovesTransferEncodingHeader() throws Exception { MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 304, MultiMap.caseInsensitiveMultiMap().set("transfer-encoding", "chunked")); assertNull(respHeaders.get("content-length")); assertNull(respHeaders.get("transfer-encoding")); }