@Test void shouldFail_ifCodeDoesNotMatch() { Response response = mock(Response.class); when(response.status()).thenReturn(200); RetryContext context = new RetryContext(1, null, response); assertThat(condition.test(context)).isFalse(); }
@Override public boolean test(final RetryContext retryContext) { return retryContext.getResponse() .map(response -> statusCode.equals(response.status())) .orElse(false); }
StatusCodeCondition implements RetryCondition { @Override public boolean test(final RetryContext retryContext) { return retryContext.getResponse() .map(response -> statusCode.equals(response.status())) .orElse(false); } }
StatusCodeCondition implements RetryCondition { @Override public boolean test(final RetryContext retryContext) { return retryContext.getResponse() .map(response -> statusCode.equals(response.status())) .orElse(false); } StatusCodeCondition(Integer statusCode); }
StatusCodeCondition implements RetryCondition { @Override public boolean test(final RetryContext retryContext) { return retryContext.getResponse() .map(response -> statusCode.equals(response.status())) .orElse(false); } StatusCodeCondition(Integer statusCode); @Override boolean test(final RetryContext retryContext); }
StatusCodeCondition implements RetryCondition { @Override public boolean test(final RetryContext retryContext) { return retryContext.getResponse() .map(response -> statusCode.equals(response.status())) .orElse(false); } StatusCodeCondition(Integer statusCode); @Override boolean test(final RetryContext retryContext);  }