@Test public void retryOnResultFailAfterMaxAttemptsUsingObservable() throws InterruptedException { RetryConfig config = RetryConfig.<String>custom() .retryOnResult("retry"::equals) .waitDuration(Duration.ofMillis(50)) .maxAttempts(3).build(); Retry retry = Retry.of("testName", config); given(helloWorldService.returnHelloWorld()) .willReturn("retry"); Observable.fromCallable(helloWorldService::returnHelloWorld) .compose(RetryTransformer.of(retry)) .test() .await() .assertValueCount(1) .assertValue("retry") .assertComplete() .assertSubscribed(); then(helloWorldService).should(times(3)).returnHelloWorld(); }
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);  }