use of io.reactivex.rxjava3.internal.operators.mixed.FlowableConcatMapSingle.ConcatMapSingleSubscriber in project RxJava by ReactiveX.
the class FlowableConcatMapSingleTest method cancelNoConcurrentClean.
@Test
public void cancelNoConcurrentClean() {
TestSubscriber<Integer> ts = new TestSubscriber<>();
ConcatMapSingleSubscriber<Integer, Integer> operator = new ConcatMapSingleSubscriber<>(ts, Functions.justFunction(Single.<Integer>never()), 16, ErrorMode.IMMEDIATE);
operator.onSubscribe(new BooleanSubscription());
operator.queue.offer(1);
operator.getAndIncrement();
ts.cancel();
assertFalse(operator.queue.isEmpty());
operator.addAndGet(-2);
operator.cancel();
assertTrue(operator.queue.isEmpty());
}
Aggregations