@Test public void returnOnErrorUsingMaybe() throws InterruptedException { RetryConfig config = retryConfig(); Retry retry = Retry.of("testName", config); given(helloWorldService.returnHelloWorld()) .willThrow(new HelloWorldException()); Maybe.fromCallable(helloWorldService::returnHelloWorld) .compose(RetryTransformer.of(retry)) .test() .await() .assertError(HelloWorldException.class) .assertNotComplete() .assertSubscribed(); Maybe.fromCallable(helloWorldService::returnHelloWorld) .compose(RetryTransformer.of(retry)) .test() .await() .assertError(HelloWorldException.class) .assertNotComplete() .assertSubscribed(); then(helloWorldService).should(times(6)).returnHelloWorld(); Retry.Metrics metrics = retry.getMetrics(); assertThat(metrics.getNumberOfFailedCallsWithRetryAttempt()).isEqualTo(2); assertThat(metrics.getNumberOfFailedCallsWithoutRetryAttempt()).isEqualTo(0); }
public static <T> RetryTransformer<T> of(Retry retry) { return new RetryTransformer<>(retry); }
RetryTransformer implements FlowableTransformer<T, T>, ObservableTransformer<T, T>,
    SingleTransformer<T, T>, CompletableTransformer, MaybeTransformer<T, T> { public static <T> RetryTransformer<T> of(Retry retry) { return new RetryTransformer<>(retry); } }
RetryTransformer implements FlowableTransformer<T, T>, ObservableTransformer<T, T>,
    SingleTransformer<T, T>, CompletableTransformer, MaybeTransformer<T, T> { public static <T> RetryTransformer<T> of(Retry retry) { return new RetryTransformer<>(retry); } private  RetryTransformer(Retry retry); }
RetryTransformer implements FlowableTransformer<T, T>, ObservableTransformer<T, T>,
    SingleTransformer<T, T>, CompletableTransformer, MaybeTransformer<T, T> { public static <T> RetryTransformer<T> of(Retry retry) { return new RetryTransformer<>(retry); } private  RetryTransformer(Retry retry); static RetryTransformer<T> of(Retry retry); @Override Publisher<T> apply(Flowable<T> upstream); @Override ObservableSource<T> apply(Observable<T> upstream); @Override SingleSource<T> apply(Single<T> upstream); @Override CompletableSource apply(Completable upstream); @Override MaybeSource<T> apply(Maybe<T> upstream); }
RetryTransformer implements FlowableTransformer<T, T>, ObservableTransformer<T, T>,
    SingleTransformer<T, T>, CompletableTransformer, MaybeTransformer<T, T> { public static <T> RetryTransformer<T> of(Retry retry) { return new RetryTransformer<>(retry); } private  RetryTransformer(Retry retry); static RetryTransformer<T> of(Retry retry); @Override Publisher<T> apply(Flowable<T> upstream); @Override ObservableSource<T> apply(Observable<T> upstream); @Override SingleSource<T> apply(Single<T> upstream); @Override CompletableSource apply(Completable upstream); @Override MaybeSource<T> apply(Maybe<T> upstream);  }