diff --git a/core-java/src/test/java/com/baeldung/java/nio2/async/AsyncFileTest.java b/core-java/src/test/java/com/baeldung/java/nio2/async/AsyncFileTest.java index fcffc524b1..b03acf83ca 100644 --- a/core-java/src/test/java/com/baeldung/java/nio2/async/AsyncFileTest.java +++ b/core-java/src/test/java/com/baeldung/java/nio2/async/AsyncFileTest.java @@ -59,9 +59,9 @@ public class AsyncFileTest { @Test public void givenPathAndContent_whenWritesToFileWithFuture_thenCorrect() throws IOException, ExecutionException, InterruptedException { - String fileName = UUID.randomUUID().toString(); - Path path = Paths.get(Paths.get(HOME)); - AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(path, StandardOpenOption.WRITE, StandardOpenOption.CREATE,StandardOpenOption.DELETE_ON_CLOSE); + String fileName = "temp"; + Path path = Paths.get(fileName); + AsynchronousFileChannel fileChannel = AsynchronousFileChannel.open(path, StandardOpenOption.WRITE, StandardOpenOption.CREATE); ByteBuffer buffer = ByteBuffer.allocate(1024); long position = 0;