Add cleanUp

This commit is contained in:
azhwani
2020-09-25 18:40:26 +01:00
parent 4472ba78d2
commit d7d834f625

View File

@@ -9,6 +9,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -57,8 +58,7 @@ public class LastModifiedFileAppUnitTest {
Path lastModPath = LastModifiedFileApp.findUsingNIOApi(SOURCEDIRECTORY);
assertThat(lastModPath).isNotNull();
assertThat(lastModPath.toFile()
.getName()).isEqualTo("file02.txt");
assertThat(lastModPath.toFile().getName()).isEqualTo("file02.txt");
}
@Test
@@ -69,4 +69,10 @@ public class LastModifiedFileAppUnitTest {
assertThat(lastModFile.getName()).isEqualTo("file02.txt");
}
@AfterAll
public static void cleanUp() throws IOException {
File srcDir = new File(SOURCEDIRECTORY);
FileUtils.deleteDirectory(srcDir);
}
}