You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/03/03 08:20:25 UTC

[GitHub] [commons-collections] nhojpatrick commented on a change in pull request #282: JUnit v5 assertThrows no2

nhojpatrick commented on a change in pull request #282:
URL: https://github.com/apache/commons-collections/pull/282#discussion_r818412579



##########
File path: src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionTest.java
##########
@@ -82,12 +84,9 @@ public PredicatedCollectionTest(final String name) {
     public void testIllegalAdd() {
         final Collection<E> c = makeTestCollection();
         final Integer i = 3;
-        try {
-            c.add((E) i);
-            fail("Integer should fail string predicate.");
-        } catch (final IllegalArgumentException e) {
-            // expected
-        }
+
+        assertThrows(IllegalArgumentException.class, () -> c.add((E) i));

Review comment:
       added back in next push.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org