@Test
void shouldProtocolErrorWhenNoReaders()
{

    // Given
    MultiDatabasesRoutingProcedureRunner mockedRunner = newMultiDBProcedureRunnerMock();
    Connection connection = mock( Connection.class );
    Clock mockedClock = mock( Clock.class );
    ClusterCompositionProvider provider =
            newClusterCompositionProvider( mockedRunner, connection, mockedClock );
    Record record = new InternalRecord( asList( "ttl", "servers" ), new Value[]{
            value( 100 ), value( asList(
            serverInfo( "WRITE", "one:1337" ),
            serverInfo( "ROUTE", "one:1337", "two:1337" ) ) )
    } );
    RoutingProcedureResponse routingResponse = newRoutingResponse( record );
    when( mockedRunner.run( eq( connection ), any( DatabaseName.class ), any(InternalBookmark.class ) ) ).thenReturn( completedFuture( routingResponse ) );
    when( mockedClock.millis() ).thenReturn( 12345L );
    // When
    ProtocolException error = assertThrows( ProtocolException.class,
            () -> await( provider.getClusterComposition( connection, defaultDatabase(), empty() ) ) );
    assertThat( error.getMessage(), containsString( "no router or reader found in response." ) );
}