diff --git a/fileservice/src/test/java/org/apache/asyncweb/fileservice/fileloader/MmapFileLoaderTest.java b/fileservice/src/test/java/org/apache/asyncweb/fileservice/fileloader/MmapFileLoaderTest.java index d016219..530b0f7 100644 --- a/fileservice/src/test/java/org/apache/asyncweb/fileservice/fileloader/MmapFileLoaderTest.java +++ b/fileservice/src/test/java/org/apache/asyncweb/fileservice/fileloader/MmapFileLoaderTest.java @@ -4,6 +4,7 @@ import java.io.File; import java.io.FileOutputStream; +import java.nio.file.Files; import java.util.Random; import org.apache.asyncweb.fileservice.fileloader.FileLoader; @@ -18,7 +19,7 @@ public class MmapFileLoaderTest { @Test public void testLoadFile() throws Exception { // generate temp file - File tempFile=File.createTempFile("dummy",null); + File tempFile=Files.createTempFile("dummy", null).toFile(); tempFile.deleteOnExit(); FileOutputStream fos=new FileOutputStream(tempFile); Random rng=new Random(); diff --git a/fileservice/src/test/java/org/apache/asyncweb/fileservice/fileloader/SimpleFileLoaderTest.java b/fileservice/src/test/java/org/apache/asyncweb/fileservice/fileloader/SimpleFileLoaderTest.java index 46e6fc7..0695112 100644 --- a/fileservice/src/test/java/org/apache/asyncweb/fileservice/fileloader/SimpleFileLoaderTest.java +++ b/fileservice/src/test/java/org/apache/asyncweb/fileservice/fileloader/SimpleFileLoaderTest.java @@ -4,6 +4,7 @@ import java.io.File; import java.io.FileOutputStream; +import java.nio.file.Files; import java.util.Random; import org.apache.asyncweb.fileservice.fileloader.SimpleFileLoader; @@ -17,7 +18,7 @@ public class SimpleFileLoaderTest { @Test public void testLoadFile() throws Exception { // generate temp file - File tempFile=File.createTempFile("dummy",null); + File tempFile=Files.createTempFile("dummy", null).toFile(); tempFile.deleteOnExit(); FileOutputStream fos=new FileOutputStream(tempFile); Random rng=new Random();