@Test
void shouldPropagateConnectionFailureExceptions()
{

    // Given
    RoutingProcedureRunner mockedRunner = newProcedureRunnerMock();
    Connection connection = mock( Connection.class );
    ClusterCompositionProvider provider =
            newClusterCompositionProvider( mockedRunner, connection );
    when( mockedRunner.run( eq( connection ), any( DatabaseName.class ), any(InternalBookmark.class ) ) ).thenReturn( failedFuture(
            new ServiceUnavailableException( "Connection breaks during cypher execution" ) ) );
    // When & Then
    ServiceUnavailableException e = assertThrows( ServiceUnavailableException.class,
            () -> await( provider.getClusterComposition( connection, defaultDatabase(), empty() ) ) );
    assertThat( e.getMessage(), containsString( "Connection breaks during cypher execution" ) );
}