This is an automated email from the ASF dual-hosted git repository.
garydgregory 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 22a4d321f Use JUnit fail()
22a4d321f is described below
commit 22a4d321f78267f41755430a32ec3852b88d841c
Author: Gary Gregory <[email protected]>
AuthorDate: Wed Nov 11 14:52:56 2026 -0500
Use JUnit fail()
---
src/test/java/org/apache/commons/collections4/MockTestCase.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/test/java/org/apache/commons/collections4/MockTestCase.java
b/src/test/java/org/apache/commons/collections4/MockTestCase.java
index e1accc0e3..58d4789fd 100644
--- a/src/test/java/org/apache/commons/collections4/MockTestCase.java
+++ b/src/test/java/org/apache/commons/collections4/MockTestCase.java
@@ -16,6 +16,8 @@
*/
package org.apache.commons.collections4;
+import static org.junit.jupiter.api.Assertions.fail;
+
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
@@ -58,8 +60,7 @@ public abstract class MockTestCase {
try {
EasyMock.verify(i.next());
} catch (final AssertionError e) {
- throw new AssertionError(i.previousIndex() + 1 +
StringUtils.EMPTY
- + e.getMessage());
+ fail("Mock object " + (i.previousIndex() + 1) + " failed
verification: " + e.getMessage(), e);
}
}
}