File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717package org .apache .commons .io ;
1818
1919import static org .junit .jupiter .api .Assertions .assertArrayEquals ;
20+ import static org .junit .jupiter .api .Assertions .assertDoesNotThrow ;
2021import static org .junit .jupiter .api .Assertions .assertEquals ;
2122import static org .junit .jupiter .api .Assertions .assertFalse ;
2223import static org .junit .jupiter .api .Assertions .assertNotNull ;
@@ -137,18 +138,18 @@ public void setUp() {
137138 }
138139 }
139140
140- @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
141141 @ Test public void testCloseQuietly_AllCloseableIOException () {
142142 final Closeable closeable = () -> {
143143 throw new IOException ();
144144 };
145- IOUtils .closeQuietly (closeable , null , closeable );
145+ assertDoesNotThrow (() -> IOUtils .closeQuietly (closeable , null , closeable ) );
146146 }
147147
148- @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
149148 @ Test public void testCloseQuietly_CloseableIOException () {
150- IOUtils .closeQuietly ((Closeable ) () -> {
151- throw new IOException ();
149+ assertDoesNotThrow (() -> {
150+ IOUtils .closeQuietly ((Closeable ) () -> {
151+ throw new IOException ();
152+ });
152153 });
153154 }
154155
You can’t perform that action at this time.
0 commit comments