Assert.assertEquals(200, response.getStatus());
// Wait until we block
Assert.assertTrue(waitLatch.await(5, TimeUnit.SECONDS));
// Fail the response
response.abort(new Exception());
closeLatch.countDown();
// Be sure we're not stuck waiting
Assert.assertTrue(waitedLatch.await(5, TimeUnit.SECONDS));
}