@Test
void shouldFailAsyncResultWhenRunFailed() throws Throwable
{

    // Given
    Throwable error = new RuntimeException( "Hi there" );
    ResultCursorFactory cursorFactory = newResultCursorFactory( failedFuture( error ), true );
    // When
    CompletionStage<AsyncResultCursor> cursorFuture = cursorFactory.asyncResult();
    // Then
    CompletionException actual = assertThrows( CompletionException.class, () -> getNow( cursorFuture ) );
    assertThat( actual.getCause(), equalTo( error ) );
}