Use better JUnit API

This commit is contained in:
Gary Gregory 2024-03-22 16:23:42 -04:00
parent 4fcc82bcb1
commit 3be8aba2da
1 changed files with 3 additions and 2 deletions

View File

@ -19,6 +19,7 @@ package org.apache.commons.lang3;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
@ -45,8 +46,8 @@ public class SystemPropertiesTest {
System.setProperty(key, Boolean.toString(Boolean.TRUE));
assertEquals(Boolean.TRUE, SystemProperties.getBoolean(key, () -> false));
assertEquals(Boolean.TRUE, SystemProperties.getBoolean(absentKey, () -> Boolean.TRUE));
assertEquals(false, SystemProperties.getBoolean(absentKey, () -> false));
assertEquals(false, SystemProperties.getBoolean(absentKey, null));
assertFalse(SystemProperties.getBoolean(absentKey, () -> false));
assertFalse(SystemProperties.getBoolean(absentKey, null));
} finally {
System.clearProperty(key);
}