@Test(groups = { "standalone", "default_provider" })
public void testAccumulateErrorBody() throws Exception {
SimpleAsyncHttpClient client = new SimpleAsyncHttpClient.Builder().setProviderClass(getProviderClass()).setUrl(getTargetUrl() + "/nonexistent").setErrorDocumentBehaviour(ErrorDocumentBehaviour.ACCUMULATE).build();
try {
ByteArrayOutputStream o = new ByteArrayOutputStream(10);
Future<Response> future = client.get(new OutputStreamBodyConsumer(o));
System.out.println("waiting for response");
Response response = future.get();
assertEquals(response.getStatusCode(), 404);
assertEquals(o.toString(), "");