Skip to content

Commit

Permalink
Reuse FileUtils in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jul 19, 2023
1 parent 1bcf13c commit 2927ab5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
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;

Expand Down Expand Up @@ -788,7 +789,7 @@ public void testSubsetCanResolve() throws Exception {
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
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;

Expand Down Expand Up @@ -396,7 +397,7 @@ public void testSubsetCanResolve() throws Exception {
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
Expand Down

0 comments on commit 2927ab5

Please sign in to comment.