package de.retest.recheck.util;

import static org.assertj.core.api.Assertions.assertThat;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

public class DeleteOnCloseFileInputStreamTest {

	@Rule
	public TemporaryFolder tempFolder = new TemporaryFolder();

	@Test
	public void file_should_be_deleted_on_close() throws IOException {
		final File file = tempFolder.newFile();
		final InputStream in = new DeleteOnCloseFileInputStream( file );

		in.close();

		assertThat( file ).doesNotExist();
	}

}

@@ -89,29 +89,8 @@
 t;%0A%0A
-import java.io.File;%0A
 impo
@@ -145,31 +145,63 @@
 am;%0A
-%0A
 import 
-org.junit.Rule;
+java.nio.file.Files;%0Aimport java.nio.file.Path;%0A
 %0Aimp
@@ -214,16 +214,28 @@
 g.junit.
+jupiter.api.
 Test;%0Aim
@@ -253,39 +253,33 @@
 nit.
-rules.TemporaryFolder;%0A%0Apublic 
+jupiter.api.io.TempDir;%0A%0A
 clas
@@ -322,89 +322,14 @@
 %0A%0A%09@
-Rule%0A%09public TemporaryFolder tempFolder = new TemporaryFolder();%0A%0A%09@Test%0A%09public 
+Test%0A%09
 void
@@ -361,16 +361,42 @@
 n_close(
+ @TempDir final Path temp 
 ) throws
@@ -418,20 +418,20 @@
 %09%09final 
-File
+Path
  file = 
@@ -438,23 +438,52 @@
 temp
-Folder.newFile(
+.resolve( %22foo%22 );%0A%09%09Files.createFile( file 
 );%0A%09
@@ -540,24 +540,33 @@
 Stream( file
+.toFile()
  );%0A%0A%09%09in.cl

Migrate to JUnit 5