Faster StopWatchTest.testStopInstantSimple()
- Replace Matcher calls with sane assertTrue()
This commit is contained in:
parent
695986b2b9
commit
b4e4c40af1
|
@ -351,13 +351,14 @@ public class StopWatchTest extends AbstractLangTest {
|
|||
public void testStopInstantSimple() 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 Instant stopTime = watch.getStopInstant();
|
||||
assertEquals(stopTime, watch.getStopInstant());
|
||||
assertThat("stopTime", stopTime,
|
||||
allOf(greaterThanOrEqualTo(Instant.ofEpochMilli(testStartMillis)), lessThanOrEqualTo(Instant.ofEpochMilli(testEndMillis))));
|
||||
// Only less than, not equal
|
||||
assertTrue(testStartMillis < testEndMillis);
|
||||
assertTrue(Instant.ofEpochMilli(testStartMillis).isBefore(Instant.ofEpochMilli(testEndMillis)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue