@Test public void doNotRetryFromPredicateUsingMaybe() { RetryConfig config = RetryConfig.custom() .retryOnException(t -> t instanceof IOException) .waitDuration(Duration.ofMillis(50)) .maxAttempts(3).build(); Retry retry = Retry.of("testName", config); given(helloWorldService.returnHelloWorld()) .willThrow(new HelloWorldException()); Maybe.fromCallable(helloWorldService::returnHelloWorld) .compose(RetryTransformer.of(retry)) .test() .assertError(HelloWorldException.class) .assertNotComplete(); then(helloWorldService).should().returnHelloWorld(); Retry.Metrics metrics = retry.getMetrics(); assertThat(metrics.getNumberOfFailedCallsWithoutRetryAttempt()).isEqualTo(1); assertThat(metrics.getNumberOfFailedCallsWithRetryAttempt()).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);  }