DefaultRetryTemplateConverter implements RetryTemplateConverter { @Override public RetryTemplate construct(final Locked locked) { final var retryTemplate = new RetryTemplate(); retryTemplate.setRetryPolicy(resolveLockRetryPolicy(locked)); retryTemplate.setBackOffPolicy(resolveBackOffPolicy(locked)); return retryTemplate; }  @Override RetryTemplate construct(final Locked locked);  }
@Test @Locked public void shouldConstructDefaultRetryTemplate() { final var locked = new Object() {}.getClass().getEnclosingMethod().getAnnotation(Locked.class); final var converter = new DefaultRetryTemplateConverter(intervalConverter); final var retryTemplate = converter.construct(locked); assertRetryTemplateConstruction(retryTemplate, 1000L, 50L); }
@Test @Locked(retry = @Interval("100"), timeout = @Interval("2000")) public void shouldConstructCustomizedRetryTemplate() { final var locked = new Object() {}.getClass().getEnclosingMethod().getAnnotation(Locked.class); final var converter = new DefaultRetryTemplateConverter(intervalConverter); final var retryTemplate = converter.construct(locked); assertRetryTemplateConstruction(retryTemplate, 2000L, 100L); }