This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-configuration.git
The following commit(s) were added to refs/heads/master by this push: new 2927ab51 Reuse FileUtils in tests 2927ab51 is described below commit 2927ab512cc4a5bb216ffadcef44358046a09ae3 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Wed Jul 19 12:19:38 2023 -0400 Reuse FileUtils in tests --- .../org/apache/commons/configuration2/TestCompositeConfiguration.java | 3 ++- .../apache/commons/configuration2/TestNullCompositeConfiguration.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java index 330da863..9d605e53 100644 --- a/src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java +++ b/src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java @@ -45,6 +45,7 @@ import org.apache.commons.configuration2.event.ConfigurationEvent; import org.apache.commons.configuration2.event.EventListenerTestImpl; import org.apache.commons.configuration2.ex.ConfigurationRuntimeException; import org.apache.commons.configuration2.io.FileHandler; +import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -788,7 +789,7 @@ public class TestCompositeConfiguration { cc.addConfiguration(ConfigurationConverter.getConfiguration(System.getProperties())); final Configuration subset = cc.subset("subset"); - assertEquals(System.getProperty("java.io.tmpdir") + "/file.tmp", subset.getString("tempfile")); + assertEquals(FileUtils.getTempDirectoryPath() + "/file.tmp", subset.getString("tempfile")); } @Test diff --git a/src/test/java/org/apache/commons/configuration2/TestNullCompositeConfiguration.java b/src/test/java/org/apache/commons/configuration2/TestNullCompositeConfiguration.java index 37ecf835..0c5b65be 100644 --- a/src/test/java/org/apache/commons/configuration2/TestNullCompositeConfiguration.java +++ b/src/test/java/org/apache/commons/configuration2/TestNullCompositeConfiguration.java @@ -33,6 +33,7 @@ import java.util.List; import org.apache.commons.configuration2.convert.LegacyListDelimiterHandler; import org.apache.commons.configuration2.convert.ListDelimiterHandler; import org.apache.commons.configuration2.io.FileHandler; +import org.apache.commons.io.FileUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -396,7 +397,7 @@ public class TestNullCompositeConfiguration { cc.addConfiguration(ConfigurationConverter.getConfiguration(System.getProperties())); final Configuration subset = cc.subset("subset"); - assertEquals(System.getProperty("java.io.tmpdir") + "/file.tmp", subset.getString("tempfile")); + assertEquals(FileUtils.getTempDirectoryPath() + "/file.tmp", subset.getString("tempfile")); } @Test