diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 9c9f63a95..1476d9b93 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -22,6 +22,7 @@ + StrSubstitutor.replaceSystemProperties does not work consistently Add option to disable the "objectsTriviallyEqual" test in DiffBuilder Add (T) casts to get unit tests to pass in old JDK Add JsonToStringStyle implementation to ToStringStyle diff --git a/src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java b/src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java index c723d2490..89ee7b4aa 100644 --- a/src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java +++ b/src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java @@ -589,6 +589,18 @@ public class StrSubstitutorTest { + "directory is ${user.home}.")); } + /** + * Test for LANG-1055: StrSubstitutor.replaceSystemProperties does not work consistently + */ + @Test + public void testLANG1055() { + System.setProperty("test_key", "test_value"); + + String expected = StrSubstitutor.replace("test_key=${test_key}", System.getProperties()); + String actual = StrSubstitutor.replaceSystemProperties("test_key=${test_key}"); + assertEquals(expected, actual); + } + /** * Test the replace of a properties object */