@@ -137,19 +137,22 @@ public void setUp() {
137137 }
138138 }
139139
140+ @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
140141 @ Test public void testCloseQuietly_AllCloseableIOException () {
141142 final Closeable closeable = () -> {
142143 throw new IOException ();
143144 };
144145 IOUtils .closeQuietly (closeable , null , closeable );
145146 }
146147
148+ @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
147149 @ Test public void testCloseQuietly_CloseableIOException () {
148150 IOUtils .closeQuietly ((Closeable ) () -> {
149151 throw new IOException ();
150152 });
151153 }
152154
155+ @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
153156 @ Test public void testCloseQuietly_Selector () {
154157 Selector selector = null ;
155158 try {
@@ -160,6 +163,7 @@ public void setUp() {
160163 }
161164 }
162165
166+ @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
163167 @ Test public void testCloseQuietly_SelectorIOException () {
164168 final Selector selector = new SelectorAdapter () {
165169 @ Override
@@ -170,11 +174,13 @@ public void close() throws IOException {
170174 IOUtils .closeQuietly (selector );
171175 }
172176
177+ @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
173178 @ Test public void testCloseQuietly_SelectorNull () {
174179 final Selector selector = null ;
175180 IOUtils .closeQuietly (selector );
176181 }
177182
183+ @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
178184 @ Test public void testCloseQuietly_SelectorTwice () {
179185 Selector selector = null ;
180186 try {
@@ -186,11 +192,13 @@ public void close() throws IOException {
186192 }
187193 }
188194
195+ @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
189196 @ Test public void testCloseQuietly_ServerSocket () throws IOException {
190197 IOUtils .closeQuietly ((ServerSocket ) null );
191198 IOUtils .closeQuietly (new ServerSocket ());
192199 }
193200
201+ @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
194202 @ Test public void testCloseQuietly_ServerSocketIOException () throws IOException {
195203 IOUtils .closeQuietly (new ServerSocket () {
196204 @ Override
@@ -200,11 +208,13 @@ public void close() throws IOException {
200208 });
201209 }
202210
211+ @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
203212 @ Test public void testCloseQuietly_Socket () {
204213 IOUtils .closeQuietly ((Socket ) null );
205214 IOUtils .closeQuietly (new Socket ());
206215 }
207216
217+ @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
208218 @ Test public void testCloseQuietly_SocketIOException () {
209219 IOUtils .closeQuietly (new Socket () {
210220 @ Override
@@ -230,7 +240,6 @@ public synchronized void close() throws IOException {
230240
231241 @ Test public void testContentEquals_InputStream_InputStream () throws Exception {
232242 {
233- final ByteArrayInputStream input1 = new ByteArrayInputStream ("" .getBytes (StandardCharsets .UTF_8 ));
234243 assertTrue (IOUtils .contentEquals ((InputStream ) null , null ));
235244 }
236245 {
@@ -1266,10 +1275,12 @@ private void testToString_URL(final String encoding) throws Exception {
12661275 assertTrue (exceptionOccurred );
12671276 }
12681277
1278+ @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
12691279 @ Test public void testResourceToString_NullCharset () throws Exception {
12701280 IOUtils .resourceToString ("/test-file-utf8.bin" , null );
12711281 }
12721282
1283+ @ SuppressWarnings ("squid:S2699" ) // Suppress "Add at least one assertion to this test case"
12731284 @ Test public void testResourceToString_NullCharset_WithClassLoader () throws Exception {
12741285 IOUtils .resourceToString ("test-file-utf8.bin" , null , ClassLoader .getSystemClassLoader ());
12751286 }
0 commit comments