RequestHandler rh = new RequestHandler();
IServer server = new HttpServer(rh);
server.start();
HttpClient httpClient = new HttpClient();
IHttpResponse response = httpClient.call(new GetRequest("http://localhost:" + server.getLocalPort() + "/test?test=12&test=two"));
Assert.assertEquals(200, response.getStatus());
List<String> values = Arrays.asList(rh.getRequest().getParameterValues("test"));
Assert.assertTrue(values.contains("12"));
Assert.assertTrue(values.contains("two"));
Set<String> headerNames = rh.getRequest().getHeaderNameSet();
Assert.assertTrue(headerNames.remove("User-Agent"));
Assert.assertTrue(headerNames.remove("Host"));
Assert.assertTrue(headerNames.isEmpty());
httpClient.close();
server.close();
}