use of com.blade.kit.CaseInsensitiveHashMap in project blade by biezhi.
the class HttpRequestTest method testHeaders.
@Test
public void testHeaders() {
Request mockRequest = mockHttpRequest("GET");
Map<String, String> headers = new CaseInsensitiveHashMap<>();
headers.put("h1", "a1");
headers.put("H2", "a2");
when(mockRequest.headers()).thenReturn(headers);
Request request = new HttpRequest(mockRequest);
assertEquals("a1", request.header("h1"));
assertEquals("a1", request.header("H1"));
assertEquals("a2", request.header("h2"));
assertEquals("a2", request.header("H2"));
request.headers().forEach((key, val) -> System.out.println(key + "\t=\t" + val));
}
Aggregations