diff --git a/src/test/java/com/github/rholder/retry/StopStrategiesTest.java b/src/test/java/com/github/rholder/retry/StopStrategiesTest.java index 5cb61b4..c5c1be3 100644 --- a/src/test/java/com/github/rholder/retry/StopStrategiesTest.java +++ b/src/test/java/com/github/rholder/retry/StopStrategiesTest.java @@ -16,6 +16,7 @@ package com.github.rholder.retry; +import static java.util.concurrent.TimeUnit.*; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -39,16 +40,16 @@ public void testStopAfterAttempt() { @Test public void testStopAfterDelayWithMilliseconds() { - assertFalse(StopStrategies.stopAfterDelay(1000L).shouldStop(failedAttempt(2, 999L))); - assertTrue(StopStrategies.stopAfterDelay(1000L).shouldStop(failedAttempt(2, 1000L))); - assertTrue(StopStrategies.stopAfterDelay(1000L).shouldStop(failedAttempt(2, 1001L))); + assertFalse(StopStrategies.stopAfterDelay(1, SECONDS).shouldStop(failedAttempt(2, 999L))); + assertTrue(StopStrategies.stopAfterDelay(1, SECONDS).shouldStop(failedAttempt(2, 1000L))); + assertTrue(StopStrategies.stopAfterDelay(1, SECONDS).shouldStop(failedAttempt(2, 1001L))); } @Test public void testStopAfterDelayWithTimeUnit() { - assertFalse(StopStrategies.stopAfterDelay(1, TimeUnit.SECONDS).shouldStop(failedAttempt(2, 999L))); - assertTrue(StopStrategies.stopAfterDelay(1, TimeUnit.SECONDS).shouldStop(failedAttempt(2, 1000L))); - assertTrue(StopStrategies.stopAfterDelay(1, TimeUnit.SECONDS).shouldStop(failedAttempt(2, 1001L))); + assertFalse(StopStrategies.stopAfterDelay(1, SECONDS).shouldStop(failedAttempt(2, 999L))); + assertTrue(StopStrategies.stopAfterDelay(1, SECONDS).shouldStop(failedAttempt(2, 1000L))); + assertTrue(StopStrategies.stopAfterDelay(1, SECONDS).shouldStop(failedAttempt(2, 1001L))); } public Attempt failedAttempt(long attemptNumber, long delaySinceFirstAttempt) {