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

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


The following commit(s) were added to refs/heads/master by this push:
     new b1571cb08 Use assertThrows()
b1571cb08 is described below

commit b1571cb080d8814f7de3526d7f7072474730da17
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Fri Jul 26 10:02:29 2024 -0400

    Use assertThrows()
---
 .../apache/commons/collections4/iterators/AbstractIteratorTest.java  | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/collections4/iterators/AbstractIteratorTest.java
 
b/src/test/java/org/apache/commons/collections4/iterators/AbstractIteratorTest.java
index b1779571a..6f4d6597f 100644
--- 
a/src/test/java/org/apache/commons/collections4/iterators/AbstractIteratorTest.java
+++ 
b/src/test/java/org/apache/commons/collections4/iterators/AbstractIteratorTest.java
@@ -157,10 +157,7 @@ public abstract class AbstractIteratorTest<E> extends 
AbstractObjectTest {
 
         if (!supportsRemove()) {
             // check for UnsupportedOperationException if not supported
-            try {
-                it.remove();
-            } catch (final UnsupportedOperationException ex) {
-            }
+            assertThrows(UnsupportedOperationException.class, it::remove);
             return;
         }
 

Reply via email to