@Test
public void testGetServicesHttpException()
        throws Exception
{

    final Exception testingException = new Exception("testing exception");
    ListenableFuture<ServiceDescriptors> future = createClient(
            request -> {
                throw testingException;
            })
            .getServices("testService", "testPool");
    try {
        future.get();
        fail("Expected ExecutionException");
    }
    catch (ExecutionException e) {
        assertInstanceOf(e.getCause(), DiscoveryException.class);
        assertEquals(e.getCause().getCause(), testingException);
        assertEquals(e.getCause().getMessage(), "Lookup of testService failed");
    }
}