This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new c2e633a  Simplify using assertDoesNotThrow
c2e633a is described below

commit c2e633a494614fb5319a4b491594462d3133220a
Author: Sebb <[email protected]>
AuthorDate: Wed Aug 5 13:43:49 2020 +0100

    Simplify using assertDoesNotThrow
---
 src/test/java/org/apache/commons/io/IOUtilsTestCase.java | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/test/java/org/apache/commons/io/IOUtilsTestCase.java 
b/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
index c02b2e7..f47d708 100644
--- a/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
@@ -17,6 +17,7 @@
 package org.apache.commons.io;
 
 import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -137,18 +138,18 @@ public class IOUtilsTestCase {
         }
     }
 
-    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testCloseQuietly_AllCloseableIOException() {
         final Closeable closeable = () -> {
             throw new IOException();
         };
-        IOUtils.closeQuietly(closeable, null, closeable);
+        assertDoesNotThrow(() -> IOUtils.closeQuietly(closeable, null, 
closeable));
     }
 
-    @SuppressWarnings("squid:S2699") // Suppress "Add at least one assertion 
to this test case"
     @Test public void testCloseQuietly_CloseableIOException() {
-        IOUtils.closeQuietly((Closeable) () -> {
-            throw new IOException();
+        assertDoesNotThrow(() -> {
+            IOUtils.closeQuietly((Closeable) () -> {
+                throw new IOException();
+            });    
         });
     }
 

Reply via email to