use of io.reactivex.rxjava3.subjects.SingleSubject in project RxJava by ReactiveX.
the class FlowableMergeWithSingleTest method cancelOtherOnMainError.
@Test
public void cancelOtherOnMainError() {
PublishProcessor<Integer> pp = PublishProcessor.create();
SingleSubject<Integer> ss = SingleSubject.create();
TestSubscriber<Integer> ts = pp.mergeWith(ss).test();
assertTrue(pp.hasSubscribers());
assertTrue(ss.hasObservers());
pp.onError(new TestException());
ts.assertFailure(TestException.class);
assertFalse("main has observers!", pp.hasSubscribers());
assertFalse("other has observers", ss.hasObservers());
}
use of io.reactivex.rxjava3.subjects.SingleSubject in project RxJava by ReactiveX.
the class FlowableMergeWithSingleTest method cancelMainOnOtherError.
@Test
public void cancelMainOnOtherError() {
PublishProcessor<Integer> pp = PublishProcessor.create();
SingleSubject<Integer> ss = SingleSubject.create();
TestSubscriber<Integer> ts = pp.mergeWith(ss).test();
assertTrue(pp.hasSubscribers());
assertTrue(ss.hasObservers());
ss.onError(new TestException());
ts.assertFailure(TestException.class);
assertFalse("main has observers!", pp.hasSubscribers());
assertFalse("other has observers", ss.hasObservers());
}
use of io.reactivex.rxjava3.subjects.SingleSubject in project RxJava by ReactiveX.
the class SingleFlatMapObservableTest method errorMain.
@Test
public void errorMain() {
SingleSubject<Integer> ss = SingleSubject.create();
PublishSubject<Integer> ps = PublishSubject.create();
TestObserver<Integer> to = ss.flatMapObservable(Functions.justFunction(ps)).test();
assertTrue(ss.hasObservers());
assertFalse(ps.hasObservers());
ss.onError(new TestException());
assertFalse(ss.hasObservers());
assertFalse(ps.hasObservers());
to.assertFailure(TestException.class);
}
Aggregations