assertTrue(client.getExitEvent().getUnderlyingException() instanceof InterruptedException);
}
@Test
public void testConnectionRetries() throws Exception {
HttpHosts mockHttpHosts = mock(HttpHosts.class);
ClientBase clientBase = new ClientBase("name",
mockClient, mockHttpHosts, new RawEndpoint("/endpoint", HttpConstants.HTTP_GET), mockAuth,
mockProcessor, mockReconnectionManager, mockRateTracker
);
BasicClient client = new BasicClient(clientBase, executorService);
final CountDownLatch latch = new CountDownLatch(1);
when(mockHttpHosts.nextHost())
.thenReturn("http://somehost.com");
when(mockClient.execute(any(HttpUriRequest.class)))
.thenReturn(mockResponse)
.thenReturn(mockResponse)
.thenThrow(new IOException())