@Test
public void testWaitForFailedFutureWrappedException() {

    Exception exception = new IllegalStateException("Something went wrong");
    CompletableFuture<Object> future = failedFuture(exception);
    try {
        HttpUtils.waitFor(future);
        fail("No exception was thrown!");
    } catch (IOException e) {
        assertThat(e.getCause()).isEqualTo(exception);
    }
}