use of io.reactivex.rxjava3.internal.functions.Functions in project RxJava by ReactiveX.
the class ObservableDematerializeTest method eventsAfterDematerializedTerminal.
@Test
public void eventsAfterDematerializedTerminal() {
List<Throwable> errors = TestHelper.trackPluginErrors();
try {
new Observable<Notification<Object>>() {
@Override
protected void subscribeActual(Observer<? super Notification<Object>> observer) {
observer.onSubscribe(Disposable.empty());
observer.onNext(Notification.createOnComplete());
observer.onNext(Notification.<Object>createOnNext(1));
observer.onNext(Notification.createOnError(new TestException("First")));
observer.onError(new TestException("Second"));
}
}.dematerialize(Functions.<Notification<Object>>identity()).test().assertResult();
TestHelper.assertUndeliverable(errors, 0, TestException.class, "First");
TestHelper.assertUndeliverable(errors, 1, TestException.class, "Second");
} finally {
RxJavaPlugins.reset();
}
}
use of io.reactivex.rxjava3.internal.functions.Functions in project RxJava by ReactiveX.
the class SingleSubscribeTest method consumerDispose.
@Test
public void consumerDispose() {
PublishSubject<Integer> ps = PublishSubject.create();
Disposable d = ps.single(-99).subscribe(Functions.<Integer>emptyConsumer());
assertFalse(d.isDisposed());
d.dispose();
assertTrue(d.isDisposed());
assertFalse(ps.hasObservers());
}
Aggregations