@Test
void shouldProtocolErrorWhenMoreThanOneRecord()
{

    // Given
    RoutingProcedureRunner mockedRunner = newProcedureRunnerMock();
    Connection connection = mock( Connection.class );
    ClusterCompositionProvider provider =
            newClusterCompositionProvider( mockedRunner, connection );
    Record aRecord = new InternalRecord( asList( "key1", "key2" ), new Value[]{ new StringValue( "a value" ) } );
    RoutingProcedureResponse routingResponse = newRoutingResponse( aRecord, aRecord );
    when( mockedRunner.run( eq( connection ), any( DatabaseName.class ), any(InternalBookmark.class ) ) ).thenReturn( completedFuture( routingResponse ) );
    // When
    ProtocolException error = assertThrows( ProtocolException.class,
            () -> await( provider.getClusterComposition( connection, defaultDatabase(), empty() ) ) );
    assertThat( error.getMessage(), containsString( "records received '2' is too few or too many." ) );
}