@Test public void removeExplicitSubscriptions_passedBadAction() { pauseScheduler(); final Connector connector = createConnector(); final ChannelAddress address1 = new ChannelAddress( 1, 1, 1 ); final ArrayList<AreaOfInterestRequest> requests = new ArrayList<>(); requests.add( new AreaOfInterestRequest( address1, AreaOfInterestRequest.Type.ADD, null ) ); createSubscription( address1, null, true ); final IllegalStateException exception = expectThrows( IllegalStateException.class, () -> safeAction( () -> connector.removeExplicitSubscriptions( requests ) ) ); assertEquals( exception.getMessage(), "Replicant-0034: Connector.removeExplicitSubscriptions() invoked with request with type that is not REMOVE. Request: AreaOfInterestRequest[Type=ADD Address=1.1.1]" ); }
@Action void removeExplicitSubscriptions( @Nonnull final List<AreaOfInterestRequest> requests ) { requests.forEach( request -> { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> AreaOfInterestRequest.Type.REMOVE == request.getType(), () -> "Replicant-0034: Connector.removeExplicitSubscriptions() invoked with request " + "with type that is not REMOVE. Request: " + request ); } final Subscription subscription = getReplicantContext().findSubscription( request.getAddress() ); if ( null != subscription ) { subscription.setExplicitSubscription( false ); } } ); }
Connector extends ReplicantService { @Action void removeExplicitSubscriptions( @Nonnull final List<AreaOfInterestRequest> requests ) { requests.forEach( request -> { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> AreaOfInterestRequest.Type.REMOVE == request.getType(), () -> "Replicant-0034: Connector.removeExplicitSubscriptions() invoked with request " + "with type that is not REMOVE. Request: " + request ); } final Subscription subscription = getReplicantContext().findSubscription( request.getAddress() ); if ( null != subscription ) { subscription.setExplicitSubscription( false ); } } ); } }
Connector extends ReplicantService { @Action void removeExplicitSubscriptions( @Nonnull final List<AreaOfInterestRequest> requests ) { requests.forEach( request -> { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> AreaOfInterestRequest.Type.REMOVE == request.getType(), () -> "Replicant-0034: Connector.removeExplicitSubscriptions() invoked with request " + "with type that is not REMOVE. Request: " + request ); } final Subscription subscription = getReplicantContext().findSubscription( request.getAddress() ); if ( null != subscription ) { subscription.setExplicitSubscription( false ); } } ); } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); }
Connector extends ReplicantService { @Action void removeExplicitSubscriptions( @Nonnull final List<AreaOfInterestRequest> requests ) { requests.forEach( request -> { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> AreaOfInterestRequest.Type.REMOVE == request.getType(), () -> "Replicant-0034: Connector.removeExplicitSubscriptions() invoked with request " + "with type that is not REMOVE. Request: " + request ); } final Subscription subscription = getReplicantContext().findSubscription( request.getAddress() ); if ( null != subscription ) { subscription.setExplicitSubscription( false ); } } ); } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString(); }
Connector extends ReplicantService { @Action void removeExplicitSubscriptions( @Nonnull final List<AreaOfInterestRequest> requests ) { requests.forEach( request -> { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> AreaOfInterestRequest.Type.REMOVE == request.getType(), () -> "Replicant-0034: Connector.removeExplicitSubscriptions() invoked with request " + "with type that is not REMOVE. Request: " + request ); } final Subscription subscription = getReplicantContext().findSubscription( request.getAddress() ); if ( null != subscription ) { subscription.setExplicitSubscription( false ); } } ); } Connector( @Nullable final ReplicantContext context,
             @Nonnull final SystemSchema schema,
             @Nonnull final Transport transport ); @Override String toString();  }