Skip to content

Commit b6a5e06

Browse files
committed
Add org.apache.commons.lang3.SystemPropertiesTest.testGetPropertyStringString()
1 parent dd69d58 commit b6a5e06

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/test/java/org/apache/commons/lang3/SystemPropertiesTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,19 @@ void testGetPathSeparator() {
702702
assertNotNull(SystemProperties.getPathSeparator());
703703
}
704704

705+
@Test
706+
@SetSystemProperties({ @SetSystemProperty(key = STRING_SPACE_1, value = "value1"), @SetSystemProperty(key = STRING_TAB_1, value = "value2") })
707+
void testGetPropertyStringString() {
708+
assertNull(SystemProperties.getProperty(null, (String) null));
709+
assertNull(SystemProperties.getProperty(StringUtils.EMPTY, (String) null));
710+
assertEquals("value1", SystemProperties.getProperty(STRING_SPACE_1, (String) null));
711+
assertEquals("value2", SystemProperties.getProperty("\t", (String) null));
712+
assertEquals("x", SystemProperties.getProperty(null, "x"));
713+
assertEquals("x", SystemProperties.getProperty(StringUtils.EMPTY, "x"));
714+
assertEquals("value1", SystemProperties.getProperty(STRING_SPACE_1, "v"));
715+
assertEquals("value2", SystemProperties.getProperty("\t", "v"));
716+
}
717+
705718
@Test
706719
@SetSystemProperties({ @SetSystemProperty(key = STRING_SPACE_1, value = "value1"), @SetSystemProperty(key = STRING_TAB_1, value = "value2") })
707720
void testGetPropertyStringSupplier() {

0 commit comments

Comments
 (0)