@Test(expected = StackOverflowError.class) public void shouldNotRetryUsingMonoStackOverFlow() { RetryConfig config = retryConfig(); Retry retry = Retry.of("testName", config); RetryOperator<String> retryOperator = RetryOperator.of(retry); given(helloWorldService.returnHelloWorld()) .willThrow(new StackOverflowError("BAM!")); StepVerifier.create(Mono.fromCallable(helloWorldService::returnHelloWorld) .transformDeferred(retryOperator)) .expectSubscription() .expectError(StackOverflowError.class) .verify(Duration.ofSeconds(1)); }
public static <T> RetryOperator<T> of(Retry retry) { return new RetryOperator<>(retry); }
RetryOperator implements UnaryOperator<Publisher<T>> { public static <T> RetryOperator<T> of(Retry retry) { return new RetryOperator<>(retry); } }
RetryOperator implements UnaryOperator<Publisher<T>> { public static <T> RetryOperator<T> of(Retry retry) { return new RetryOperator<>(retry); } private  RetryOperator(Retry retry); }
RetryOperator implements UnaryOperator<Publisher<T>> { public static <T> RetryOperator<T> of(Retry retry) { return new RetryOperator<>(retry); } private  RetryOperator(Retry retry); static RetryOperator<T> of(Retry retry); @Override Publisher<T> apply(Publisher<T> publisher); }
RetryOperator implements UnaryOperator<Publisher<T>> { public static <T> RetryOperator<T> of(Retry retry) { return new RetryOperator<>(retry); } private  RetryOperator(Retry retry); static RetryOperator<T> of(Retry retry); @Override Publisher<T> apply(Publisher<T> publisher);  }