Skip to content

Commit

Permalink
Refactor constant
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Sep 4, 2024
1 parent 95d15cd commit 45f2cea
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
*/
public class StopWatchTest extends AbstractLangTest {

private static final Duration ONE_MILLISECOND = Duration.ofMillis(1);
private static final Duration MILLIS_200 = Duration.ofMillis(200);
private static final Duration MILLIS_550 = Duration.ofMillis(550);
private static final String MESSAGE = "Baking cookies";
Expand Down Expand Up @@ -200,7 +201,7 @@ public void testGetDuration() throws InterruptedException {
assertEquals(Duration.ZERO, watch.getDuration());
assertEquals(ZERO_TIME_ELAPSED, watch.toString());
watch.start();
sleep(Duration.ofMillis(1));
sleep(ONE_MILLISECOND);
final long nanos = watch.getNanoTime();
assertTrue(nanos > 0, () -> "getNanoTime(): " + nanos);
assertTrue(DurationUtils.isPositive(watch.getDuration()));
Expand Down

0 comments on commit 45f2cea

Please sign in to comment.