@Test
void shouldReturnFailureWhenProcedureRunnerFails()
{

    RoutingProcedureRunner procedureRunner = newProcedureRunnerMock();
    Connection connection = mock( Connection.class );
    RuntimeException error = new RuntimeException( "hi" );
    when( procedureRunner.run( eq( connection ), any( DatabaseName.class ), any(InternalBookmark.class ) ) )
            .thenReturn( completedFuture( newRoutingResponse( error ) ) );
    RoutingProcedureClusterCompositionProvider provider =
            newClusterCompositionProvider( procedureRunner, connection );
    RuntimeException e = assertThrows( RuntimeException.class,
            () -> await( provider.getClusterComposition( connection, defaultDatabase(), empty() ) ) );
    assertEquals( error, e );
}