use of io.reactivex.rxjava3.functions in project RxJava by ReactiveX.
the class BoundedSubscriberTest method cancel.
@Test
public void cancel() {
BoundedSubscriber<Integer> subscriber = new BoundedSubscriber<>(Functions.<Integer>emptyConsumer(), Functions.<Throwable>emptyConsumer(), Functions.EMPTY_ACTION, Functions.<Subscription>boundedConsumer(128), 128);
BooleanSubscription bs = new BooleanSubscription();
subscriber.onSubscribe(bs);
subscriber.cancel();
assertTrue(bs.isCancelled());
}
use of io.reactivex.rxjava3.functions in project RxJava by ReactiveX.
the class BoundedSubscriberTest method dispose.
@Test
public void dispose() {
BoundedSubscriber<Integer> subscriber = new BoundedSubscriber<>(Functions.<Integer>emptyConsumer(), Functions.<Throwable>emptyConsumer(), Functions.EMPTY_ACTION, Functions.<Subscription>boundedConsumer(128), 128);
BooleanSubscription bs = new BooleanSubscription();
subscriber.onSubscribe(bs);
assertFalse(subscriber.isDisposed());
subscriber.dispose();
assertTrue(bs.isCancelled());
assertTrue(subscriber.isDisposed());
}
use of io.reactivex.rxjava3.functions in project RxJava by ReactiveX.
the class FlowableDematerializeTest method errorPassThru.
@Test
public void errorPassThru() {
Exception exception = new Exception("test");
Flowable<Notification<Integer>> flowable = Flowable.error(exception);
Flowable<Integer> dematerialize = flowable.dematerialize(Functions.<Notification<Integer>>identity());
Subscriber<Integer> subscriber = TestHelper.mockSubscriber();
dematerialize.subscribe(subscriber);
verify(subscriber, times(1)).onError(exception);
verify(subscriber, times(0)).onComplete();
verify(subscriber, times(0)).onNext(any(Integer.class));
}
use of io.reactivex.rxjava3.functions in project RxJava by ReactiveX.
the class FlowableDematerializeTest method honorsContractWhenThrows.
@Test
public void honorsContractWhenThrows() {
Flowable<Integer> source = Flowable.error(new TestException());
Flowable<Integer> result = source.materialize().dematerialize(Functions.<Notification<Integer>>identity());
Subscriber<Integer> subscriber = TestHelper.mockSubscriber();
result.subscribe(subscriber);
verify(subscriber, never()).onNext(any(Integer.class));
verify(subscriber, never()).onComplete();
verify(subscriber).onError(any(TestException.class));
}
use of io.reactivex.rxjava3.functions in project RxJava by ReactiveX.
the class FlowableDematerializeTest method dematerialize3.
@Test
public void dematerialize3() {
Exception exception = new Exception("test");
Flowable<Integer> flowable = Flowable.error(exception);
Flowable<Integer> dematerialize = flowable.materialize().dematerialize(Functions.<Notification<Integer>>identity());
Subscriber<Integer> subscriber = TestHelper.mockSubscriber();
dematerialize.subscribe(subscriber);
verify(subscriber, times(1)).onError(exception);
verify(subscriber, times(0)).onComplete();
verify(subscriber, times(0)).onNext(any(Integer.class));
}
Aggregations