@Test void testReset() { ExponentialBackoffPolicy exponentialBackoffPolicy = ExponentialBackoffPolicy.builder().initialDelay(Duration.ofSeconds(20)).build(); RetryHandler retryHandler = new RetryHandler(exponentialBackoffPolicy, scheduledExecutorService); assertEquals(Duration.ofSeconds(20), retryHandler.getNextDelay()); retryHandler.scheduleRetry(() -> {}); assertEquals(Duration.ofSeconds(40), retryHandler.getNextDelay()); retryHandler.reset(); assertEquals(Duration.ofSeconds(20), retryHandler.getNextDelay()); }
public void reset() { nextDelay = exponentialBackoffPolicy.getInitialDelay(); retryCount = 0; }
RetryHandler { public void reset() { nextDelay = exponentialBackoffPolicy.getInitialDelay(); retryCount = 0; } }
RetryHandler { public void reset() { nextDelay = exponentialBackoffPolicy.getInitialDelay(); retryCount = 0; } RetryHandler(final ExponentialBackoffPolicy exponentialBackoffPolicy, final ScheduledExecutorService executor); }
RetryHandler { public void reset() { nextDelay = exponentialBackoffPolicy.getInitialDelay(); retryCount = 0; } RetryHandler(final ExponentialBackoffPolicy exponentialBackoffPolicy, final ScheduledExecutorService executor); void scheduleRetry(final Runnable runnable); boolean shouldRetry(); void reset(); Duration getNextDelay(); int getRetryCount(); }
RetryHandler { public void reset() { nextDelay = exponentialBackoffPolicy.getInitialDelay(); retryCount = 0; } RetryHandler(final ExponentialBackoffPolicy exponentialBackoffPolicy, final ScheduledExecutorService executor); void scheduleRetry(final Runnable runnable); boolean shouldRetry(); void reset(); Duration getNextDelay(); int getRetryCount();  }