@Test public void testResumeNext() { Subscription s = mock(Subscription.class); TestObservable f = new TestObservable(s, "one"); Observable<String> w = Observable.create(f); final AtomicReference<Throwable> capturedException = new AtomicReference<Throwable>(); Observable<String> observable = Observable.create(onErrorReturn(w, new Func1<Throwable, String>() { @Override public String call(Throwable e) { capturedException.set(e); return "failure"; } })); @SuppressWarnings("unchecked") Observer<String> observer = mock(Observer.class); observable.subscribe(observer); try { f.t.join(); } catch (InterruptedException e) { fail(e.getMessage()); } verify(observer, Mockito.never()).onError(any(Throwable.class)); verify(observer, times(1)).onCompleted(); verify(observer, times(1)).onNext("one"); verify(observer, times(1)).onNext("failure"); assertNotNull(capturedException.get()); }
public static <T> OnSubscribeFunc<T> onErrorReturn(Observable<? extends T> originalSequence, Func1<Throwable, ? extends T> resumeFunction) { return new OnErrorReturn<T>(originalSequence, resumeFunction); }
OperationOnErrorReturn { public static <T> OnSubscribeFunc<T> onErrorReturn(Observable<? extends T> originalSequence, Func1<Throwable, ? extends T> resumeFunction) { return new OnErrorReturn<T>(originalSequence, resumeFunction); } }
OperationOnErrorReturn { public static <T> OnSubscribeFunc<T> onErrorReturn(Observable<? extends T> originalSequence, Func1<Throwable, ? extends T> resumeFunction) { return new OnErrorReturn<T>(originalSequence, resumeFunction); }  }
OperationOnErrorReturn { public static <T> OnSubscribeFunc<T> onErrorReturn(Observable<? extends T> originalSequence, Func1<Throwable, ? extends T> resumeFunction) { return new OnErrorReturn<T>(originalSequence, resumeFunction); }  static OnSubscribeFunc<T> onErrorReturn(Observable<? extends T> originalSequence, Func1<Throwable, ? extends T> resumeFunction); }
OperationOnErrorReturn { public static <T> OnSubscribeFunc<T> onErrorReturn(Observable<? extends T> originalSequence, Func1<Throwable, ? extends T> resumeFunction) { return new OnErrorReturn<T>(originalSequence, resumeFunction); }  static OnSubscribeFunc<T> onErrorReturn(Observable<? extends T> originalSequence, Func1<Throwable, ? extends T> resumeFunction);  }