diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/streaming/TestSXSSFUnicodeSurrogates.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/streaming/TestSXSSFUnicodeSurrogates.java index aba3a2f3768..360bd0576df 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/streaming/TestSXSSFUnicodeSurrogates.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/streaming/TestSXSSFUnicodeSurrogates.java @@ -18,6 +18,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more package org.apache.poi.xssf.streaming; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; @@ -62,7 +63,7 @@ void testWriteUnicodeSurrogates() throws IOException { assertEquals(unicodeText, cell2.getStringCellValue()); } } finally { - tf.delete(); + assertTrue(tf.delete()); } } } diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFUnicodeSurrogates.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFUnicodeSurrogates.java index 506e0dead8b..48c116eb157 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFUnicodeSurrogates.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFUnicodeSurrogates.java @@ -18,6 +18,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more package org.apache.poi.xssf.usermodel; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; @@ -61,7 +62,7 @@ void testWriteUnicodeSurrogates() throws IOException { assertEquals(unicodeText, cell2.getStringCellValue()); } } finally { - tf.delete(); + assertTrue(tf.delete()); } } } diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java index 8d258bb2898..9e1a7cc0f34 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java @@ -1479,7 +1479,7 @@ void readFromZipStream() throws IOException { } assertEquals(2, count); } finally { - tempFile.delete(); + assertTrue(tempFile.delete()); } } diff --git a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java index 4faf1647314..e9a6fbf43eb 100644 --- a/poi/src/test/java/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java +++ b/poi/src/test/java/org/apache/poi/hssf/usermodel/TestPOIFSProperties.java @@ -19,6 +19,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -89,7 +90,7 @@ private void setTitle(POIFSFileSystem fs) throws NoPropertySetStreamException, I summary1.setTitle(title); //write the modified property back to POIFS - fs.getRoot().getEntryCaseInsensitive(SummaryInformation.DEFAULT_STREAM_NAME).delete(); + assertTrue(fs.getRoot().getEntryCaseInsensitive(SummaryInformation.DEFAULT_STREAM_NAME).delete()); fs.createDocument(summary1.toInputStream(), SummaryInformation.DEFAULT_STREAM_NAME); // check that the information was added successfully to the filesystem object diff --git a/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java b/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java index 7f25ca751da..0b97d8eb8c7 100644 --- a/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java +++ b/poi/src/test/java/org/apache/poi/poifs/filesystem/TestPOIFSStream.java @@ -1817,7 +1817,7 @@ void readWriteRead(String file, Function opener) throws main4096[4095] = -11; testDir.createDocument("Normal4096", new ByteArrayInputStream(main4096)); - root.getEntryCaseInsensitive("Tags").delete(); + assertTrue(root.getEntryCaseInsensitive("Tags").delete()); // Write out, re-load @@ -1848,7 +1848,7 @@ void readWriteRead(String file, Function opener) throws // Delete a directory, and add one more - testDir.getEntryCaseInsensitive("Testing 456").delete(); + assertTrue(testDir.getEntryCaseInsensitive("Testing 456").delete()); testDir.createDirectory("Testing ABC"); @@ -1903,7 +1903,7 @@ void readWriteRead(String file, Function opener) throws // Delete a mini stream, add one more - testDir.getEntryCaseInsensitive("Mini").delete(); + assertTrue(testDir.getEntryCaseInsensitive("Mini").delete()); byte[] mini3 = new byte[]{42, 0, 42, 0, 42, 0, 42}; testDir.createDocument("Mini3", new ByteArrayInputStream(mini3)); @@ -2179,8 +2179,8 @@ void createWriteRead() throws IOException { // Delete a couple of streams - miniDoc.delete(); - normDoc.delete(); + assertTrue(miniDoc.delete()); + assertTrue(normDoc.delete()); // Check - will have un-used sectors now