HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Host", "localhost");
headers.put(headerName, headerValue);
headers.put("Content-Length", String.valueOf(requestBody.length));
RHTTPRequest request = new RHTTPRequest(1, method, uri, headers, requestBody);
request = RHTTPRequest.fromRequestBytes(request.getId(), request.getRequestBytes());
connector.onRequest(request);
assertTrue(handlerLatch.await(1000, TimeUnit.MILLISECONDS));
assertTrue(clientLatch.await(1000, TimeUnit.MILLISECONDS));
RHTTPResponse response = responseRef.get();
assertEquals(request.getId(), response.getId());
assertEquals(statusCode, response.getStatusCode());
assertEquals(headerValue, response.getHeaders().get(headerName));
assertTrue(Arrays.equals(response.getBody(), responseBody));
}