@Test
void shouldRestartRequestingWhenMinimumWatermarkMet()
{

    Connection connection = connectionMock();
    InOrder inOrder = Mockito.inOrder( connection );
    //highwatermark=4, lowwatermark=2
    AutoPullResponseHandler handler = newHandler( new Query( "RETURN 1" ), connection, 7 );
    Map<String,Value> metaData = new HashMap<>( 1 );
    metaData.put( "has_more", BooleanValue.TRUE );
    inOrder.verify( connection ).writeAndFlush( any( PullMessage.class ), any() );
    handler.onRecord( values( 1 ) );
    handler.onRecord( values( 2 ) );
    handler.onRecord( values( 3 ) );
    handler.onRecord( values( 4 ) );
    handler.onRecord( values( 5 ) );
    handler.onSuccess( metaData );
    verify( connection, times( 1 ) ).writeAndFlush( any( PullMessage.class ), any() );
    handler.nextAsync();
    handler.nextAsync();
    handler.nextAsync();
    inOrder.verify( connection ).writeAndFlush( any( PullMessage.class ), any() );
}