@Test public void progressAreaOfInterestAddRequests_onFailure_zeroRequests() { final ChannelSchema channelSchema = new ChannelSchema( 0, ValueUtil.randomString(), String.class, ChannelSchema.FilterType.STATIC, null, false, true, Collections.emptyList() ); final SystemSchema schema = new SystemSchema( 1, ValueUtil.randomString(), new ChannelSchema[]{ channelSchema }, new EntitySchema[]{} ); final Connector connector = createConnector( schema ); final Connection connection = newConnection( connector ); final ChannelAddress address1 = new ChannelAddress( 1, 0, 1 ); final String filter = ValueUtil.randomString(); final AreaOfInterestRequest request1 = new AreaOfInterestRequest( address1, AreaOfInterestRequest.Type.ADD, filter ); pauseScheduler(); connection.injectCurrentAreaOfInterestRequest( request1 ); final TestSpyEventHandler handler = registerTestSpyEventHandler(); assertFalse( connection.getCurrentAreaOfInterestRequests().isEmpty() ); final ArrayList<AreaOfInterestRequest> requests = new ArrayList<>(); connector.progressAreaOfInterestAddRequests( requests ); assertTrue( connection.getCurrentAreaOfInterestRequests().isEmpty() ); handler.assertEventCount( 0 ); }
void progressAreaOfInterestAddRequests( @Nonnull final List<AreaOfInterestRequest> requests ) { if ( requests.isEmpty() ) { completeAreaOfInterestRequest(); } else if ( 1 == requests.size() ) { progressAreaOfInterestAddRequest( requests.get( 0 ) ); } else { progressBulkAreaOfInterestAddRequests( requests ); } }
Connector extends ReplicantService { void progressAreaOfInterestAddRequests( @Nonnull final List<AreaOfInterestRequest> requests ) { if ( requests.isEmpty() ) { completeAreaOfInterestRequest(); } else if ( 1 == requests.size() ) { progressAreaOfInterestAddRequest( requests.get( 0 ) ); } else { progressBulkAreaOfInterestAddRequests( requests ); } } }
Connector extends ReplicantService { void progressAreaOfInterestAddRequests( @Nonnull final List<AreaOfInterestRequest> requests ) { if ( requests.isEmpty() ) { completeAreaOfInterestRequest(); } else if ( 1 == requests.size() ) { progressAreaOfInterestAddRequest( requests.get( 0 ) ); } else { progressBulkAreaOfInterestAddRequests( requests ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); }
Connector extends ReplicantService { void progressAreaOfInterestAddRequests( @Nonnull final List<AreaOfInterestRequest> requests ) { if ( requests.isEmpty() ) { completeAreaOfInterestRequest(); } else if ( 1 == requests.size() ) { progressAreaOfInterestAddRequest( requests.get( 0 ) ); } else { progressBulkAreaOfInterestAddRequests( requests ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString(); }
Connector extends ReplicantService { void progressAreaOfInterestAddRequests( @Nonnull final List<AreaOfInterestRequest> requests ) { if ( requests.isEmpty() ) { completeAreaOfInterestRequest(); } else if ( 1 == requests.size() ) { progressAreaOfInterestAddRequest( requests.get( 0 ) ); } else { progressBulkAreaOfInterestAddRequests( requests ); } } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString();  }