use of io.reactivex.rxjava3.internal.functions.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));
}
use of io.reactivex.rxjava3.internal.functions.Functions in project RxJava by ReactiveX.
the class ObservableWindowWithTimeTest method overlappingOnError.
@Test
@SuppressUndeliverable
public void overlappingOnError() {
TestScheduler scheduler = new TestScheduler();
PublishSubject<Integer> ps = PublishSubject.create();
TestObserver<Integer> to = ps.window(2, 1, TimeUnit.SECONDS, scheduler).flatMap(Functions.<Observable<Integer>>identity()).test();
ps.onError(new TestException());
to.assertFailure(TestException.class);
}
use of io.reactivex.rxjava3.internal.functions.Functions in project RxJava by ReactiveX.
the class ObservableWindowWithTimeTest method skipOnError.
@Test
@SuppressUndeliverable
public void skipOnError() {
TestScheduler scheduler = new TestScheduler();
PublishSubject<Integer> ps = PublishSubject.create();
TestObserver<Integer> to = ps.window(1, 2, TimeUnit.SECONDS, scheduler).flatMap(Functions.<Observable<Integer>>identity()).test();
ps.onError(new TestException());
to.assertFailure(TestException.class);
}
use of io.reactivex.rxjava3.internal.functions.Functions in project RxJava by ReactiveX.
the class ObservableWindowWithStartEndObservableTest method endError.
@Test
@SuppressUndeliverable
public void endError() {
PublishSubject<Integer> source = PublishSubject.create();
PublishSubject<Integer> start = PublishSubject.create();
final PublishSubject<Integer> end = PublishSubject.create();
TestObserver<Integer> to = source.window(start, new Function<Integer, ObservableSource<Integer>>() {
@Override
public ObservableSource<Integer> apply(Integer v) throws Exception {
return end;
}
}).flatMap(Functions.<Observable<Integer>>identity()).test();
start.onNext(1);
end.onError(new TestException());
to.assertFailure(TestException.class);
assertFalse("Source has observers!", source.hasObservers());
assertFalse("Start has observers!", start.hasObservers());
assertFalse("End has observers!", end.hasObservers());
}
use of io.reactivex.rxjava3.internal.functions.Functions in project RxJava by ReactiveX.
the class ParallelSortedJoinTest method error2.
@Test
public void error2() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
ParallelFlowable.fromArray(Flowable.<Integer>error(new IOException()), Flowable.<Integer>error(new TestException())).sorted(Functions.<Integer>naturalComparator()).test().assertFailure(IOException.class);
TestHelper.assertUndeliverable(errors, 0, TestException.class);
} finally {
RxJavaPlugins.reset();
}
}
Aggregations