String body = buffer.toString();
conn.addResponse(headers, body);
conn.open();
HttpMethodBase method = new GetMethod("/");
method.execute(new HttpState(), conn);
Reader response = new InputStreamReader(method.getResponseBodyAsStream());
int c;
while ((c = response.read()) != -1) {
assertEquals((int) 'A', c);
}