@Test void shouldPass_ifExceptionMatches() { RetryContext context = new RetryContext(1, new IOException("stuck"), null); assertThat(condition.test(context)).isTrue(); }
@Override public boolean test(RetryContext retryContext) { return retryContext.getLastException() .map(throwable -> exception.isAssignableFrom(throwable.getClass())) .orElse(false); }
ExceptionCondition implements RetryCondition { @Override public boolean test(RetryContext retryContext) { return retryContext.getLastException() .map(throwable -> exception.isAssignableFrom(throwable.getClass())) .orElse(false); } }
ExceptionCondition implements RetryCondition { @Override public boolean test(RetryContext retryContext) { return retryContext.getLastException() .map(throwable -> exception.isAssignableFrom(throwable.getClass())) .orElse(false); } ExceptionCondition(Class<? extends Throwable> exception); }
ExceptionCondition implements RetryCondition { @Override public boolean test(RetryContext retryContext) { return retryContext.getLastException() .map(throwable -> exception.isAssignableFrom(throwable.getClass())) .orElse(false); } ExceptionCondition(Class<? extends Throwable> exception); @Override boolean test(RetryContext retryContext); }
ExceptionCondition implements RetryCondition { @Override public boolean test(RetryContext retryContext) { return retryContext.getLastException() .map(throwable -> exception.isAssignableFrom(throwable.getClass())) .orElse(false); } ExceptionCondition(Class<? extends Throwable> exception); @Override boolean test(RetryContext retryContext);  }