Skip to content

Commit

Permalink
Faster StopWatchTest.testStopTimeSimple()
Browse files Browse the repository at this point in the history
- Replace Matcher calls with sane assertTrue()
  • Loading branch information
garydgregory committed Sep 4, 2024
1 parent b4e4c40 commit a905cc5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,12 @@ public void testStopInstantSimple() throws InterruptedException {
public void testStopTimeSimple() throws InterruptedException {
final StopWatch watch = StopWatch.createStarted();
final long testStartMillis = System.currentTimeMillis();
sleep(MILLIS_550);
sleep(TWO_MILLISECOND);
watch.stop();
final long testEndMillis = System.currentTimeMillis();
final long stopTime = watch.getStopTime();
assertEquals(stopTime, watch.getStopTime());
assertThat("stopTime", stopTime, allOf(greaterThanOrEqualTo(testStartMillis), lessThanOrEqualTo(testEndMillis)));
assertTrue(testStartMillis < testEndMillis);
}

@Test
Expand Down

0 comments on commit a905cc5

Please sign in to comment.