You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/09/04 15:00:53 UTC
(commons-lang) branch master updated: Refactor constant
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new 45f2ceaf3 Refactor constant
45f2ceaf3 is described below
commit 45f2ceaf3c0111c731ce4cd9233803175ac16783
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Sep 4 11:00:48 2024 -0400
Refactor constant
---
src/test/java/org/apache/commons/lang3/time/StopWatchTest.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java b/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java
index 5a3fa48c2..04f58d547 100644
--- a/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java
+++ b/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java
@@ -44,6 +44,7 @@ import org.junit.jupiter.api.Test;
*/
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";
@@ -200,7 +201,7 @@ public class StopWatchTest extends AbstractLangTest {
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()));