HttpServer server = new HttpServer(new RequestHandler());
server.start();
HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
FutureResponseHandler respHdl = new FutureResponseHandler();
BodyDataSink bodyDataSink = con.send(new HttpRequestHeader("POST", "/"), 100, respHdl);
bodyDataSink.write(QAUtil.generateByteArray(100));
bodyDataSink.close();
IHttpResponse response = respHdl.getResponse();
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("it works", response.getBody().toString());
con.close();
server.close();