Вы можете найти пример кода, который я использую, по следующей ссылке:
Почему у меня есть java.io. IOException: поток закрыт в моем тесте?
Резюме кода:
Код: Выделить всё
//I recover the zip
ZipFile zipFile = new ZipFile( "src/test/resources/exported_data_test.zip");
List entries = zipFile.stream().map(ZipEntry::getName).collect(Collectors.toList())
//Doing assertions...
//Deletion of the zip
File file = new File( "src/test/resources/exported_data_test.zip");
file.delete();

Может ли кто-нибудь помочь мне удалить zip-файл в конце теста?
Подробнее здесь: https://stackoverflow.com/questions/787 ... -unit-test