Assert.assertEquals(303, response1.getStatus());
Assert.assertTrue(redirector.isRedirect(response1));
Result result = redirector.redirect(request1, response1);
org.eclipse.jetty.client.api.Request request2 = result.getRequest();
Response response2 = result.getResponse();
Assert.assertEquals(302, response2.getStatus());
Assert.assertTrue(redirector.isRedirect(response2));
final CountDownLatch latch = new CountDownLatch(1);
redirector.redirect(request2, response2, new Response.CompleteListener()
{
@Override
public void onComplete(Result result)
{
Response response3 = result.getResponse();
Assert.assertEquals(200, response3.getStatus());
Assert.assertFalse(redirector.isRedirect(response3));
latch.countDown();
}
});
Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));