@Test
void shouldProtocolErrorWhenNoRecord()
{

    // Given
    RoutingProcedureRunner mockedRunner = newProcedureRunnerMock();
    Connection connection = mock( Connection.class );
    ClusterCompositionProvider provider =
            newClusterCompositionProvider( mockedRunner, connection );
    RoutingProcedureResponse noRecordsResponse = newRoutingResponse();
    when( mockedRunner.run( eq( connection ), any( DatabaseName.class ), any( InternalBookmark.class ) ) )
            .thenReturn( completedFuture( noRecordsResponse ) );
    // When & Then
    ProtocolException error = assertThrows( ProtocolException.class,
            () -> await( provider.getClusterComposition( connection, defaultDatabase(), empty() ) ) );
    assertThat( error.getMessage(), containsString( "records received '0' is too few or too many." ) );
}