@Test public void testReactorTypes() throws Throwable { Retry retry = Retry.ofDefaults("test"); when(proceedingJoinPoint.proceed()).thenReturn(Mono.just("Test")); assertThat(reactorRetryAspectExt.handle(proceedingJoinPoint, retry, "testMethod")) .isNotNull(); when(proceedingJoinPoint.proceed()).thenReturn(Flux.just("Test")); assertThat(reactorRetryAspectExt.handle(proceedingJoinPoint, retry, "testMethod")) .isNotNull(); }
@Override public Object handle(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.retry.Retry retry, String methodName) throws Throwable { Object returnValue = proceedingJoinPoint.proceed(); if (Flux.class.isAssignableFrom(returnValue.getClass())) { Flux<?> fluxReturnValue = (Flux<?>) returnValue; return fluxReturnValue.transformDeferred(RetryOperator.of(retry)); } else if (Mono.class.isAssignableFrom(returnValue.getClass())) { Mono<?> monoReturnValue = (Mono<?>) returnValue; return monoReturnValue.transformDeferred(RetryOperator.of(retry)); } else { logger.error("Unsupported type for Reactor retry {}", returnValue.getClass().getTypeName()); throw new IllegalArgumentException( "Not Supported type for the retry in Reactor :" + returnValue.getClass().getName()); } }
ReactorRetryAspectExt implements RetryAspectExt { @Override public Object handle(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.retry.Retry retry, String methodName) throws Throwable { Object returnValue = proceedingJoinPoint.proceed(); if (Flux.class.isAssignableFrom(returnValue.getClass())) { Flux<?> fluxReturnValue = (Flux<?>) returnValue; return fluxReturnValue.transformDeferred(RetryOperator.of(retry)); } else if (Mono.class.isAssignableFrom(returnValue.getClass())) { Mono<?> monoReturnValue = (Mono<?>) returnValue; return monoReturnValue.transformDeferred(RetryOperator.of(retry)); } else { logger.error("Unsupported type for Reactor retry {}", returnValue.getClass().getTypeName()); throw new IllegalArgumentException( "Not Supported type for the retry in Reactor :" + returnValue.getClass().getName()); } } }
ReactorRetryAspectExt implements RetryAspectExt { @Override public Object handle(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.retry.Retry retry, String methodName) throws Throwable { Object returnValue = proceedingJoinPoint.proceed(); if (Flux.class.isAssignableFrom(returnValue.getClass())) { Flux<?> fluxReturnValue = (Flux<?>) returnValue; return fluxReturnValue.transformDeferred(RetryOperator.of(retry)); } else if (Mono.class.isAssignableFrom(returnValue.getClass())) { Mono<?> monoReturnValue = (Mono<?>) returnValue; return monoReturnValue.transformDeferred(RetryOperator.of(retry)); } else { logger.error("Unsupported type for Reactor retry {}", returnValue.getClass().getTypeName()); throw new IllegalArgumentException( "Not Supported type for the retry in Reactor :" + returnValue.getClass().getName()); } }  }
ReactorRetryAspectExt implements RetryAspectExt { @Override public Object handle(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.retry.Retry retry, String methodName) throws Throwable { Object returnValue = proceedingJoinPoint.proceed(); if (Flux.class.isAssignableFrom(returnValue.getClass())) { Flux<?> fluxReturnValue = (Flux<?>) returnValue; return fluxReturnValue.transformDeferred(RetryOperator.of(retry)); } else if (Mono.class.isAssignableFrom(returnValue.getClass())) { Mono<?> monoReturnValue = (Mono<?>) returnValue; return monoReturnValue.transformDeferred(RetryOperator.of(retry)); } else { logger.error("Unsupported type for Reactor retry {}", returnValue.getClass().getTypeName()); throw new IllegalArgumentException( "Not Supported type for the retry in Reactor :" + returnValue.getClass().getName()); } }  @Override boolean canHandleReturnType(Class returnType); @Override Object handle(ProceedingJoinPoint proceedingJoinPoint,
        io.github.resilience4j.retry.Retry retry, String methodName); }
ReactorRetryAspectExt implements RetryAspectExt { @Override public Object handle(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.retry.Retry retry, String methodName) throws Throwable { Object returnValue = proceedingJoinPoint.proceed(); if (Flux.class.isAssignableFrom(returnValue.getClass())) { Flux<?> fluxReturnValue = (Flux<?>) returnValue; return fluxReturnValue.transformDeferred(RetryOperator.of(retry)); } else if (Mono.class.isAssignableFrom(returnValue.getClass())) { Mono<?> monoReturnValue = (Mono<?>) returnValue; return monoReturnValue.transformDeferred(RetryOperator.of(retry)); } else { logger.error("Unsupported type for Reactor retry {}", returnValue.getClass().getTypeName()); throw new IllegalArgumentException( "Not Supported type for the retry in Reactor :" + returnValue.getClass().getName()); } }  @Override boolean canHandleReturnType(Class returnType); @Override Object handle(ProceedingJoinPoint proceedingJoinPoint,
        io.github.resilience4j.retry.Retry retry, String methodName);  }