Skip to content

Commit 01641e8

Browse files
committed
Don't use the Maven target folder as a temporary test fixture.
Use a Junit @tempdir instead.
1 parent 723ee03 commit 01641e8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/test/java/org/apache/commons/io/FileUtilsTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
import org.junit.jupiter.api.condition.EnabledIf;
101101
import org.junit.jupiter.api.condition.EnabledOnOs;
102102
import org.junit.jupiter.api.condition.OS;
103+
import org.junit.jupiter.api.io.TempDir;
103104
import org.junit.jupiter.params.ParameterizedTest;
104105
import org.junit.jupiter.params.provider.ValueSource;
105106

@@ -1952,8 +1953,8 @@ void testGetUserDirectoryPath() {
19521953
}
19531954

19541955
@Test
1955-
void testIO276() throws Exception {
1956-
final File dir = new File("target", "IO276");
1956+
void testIO276(@TempDir File dest) throws Exception {
1957+
final File dir = new File(dest, "IO276");
19571958
Files.deleteIfExists(dir.toPath());
19581959
assertTrue(dir.mkdirs(), dir + " should not be present");
19591960
final File file = new File(dir, "IO276.txt");

0 commit comments

Comments
 (0)