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-jexl.git
commit 50c21764433fb8e742c1232075e49c60bb967679 Author: Gary Gregory <[email protected]> AuthorDate: Sat Jun 1 13:48:58 2024 -0400 Use assertThrows() --- src/test/java/org/apache/commons/jexl3/ArithmeticTest.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java b/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java index e4bda49f..4005a8e9 100644 --- a/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java +++ b/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java @@ -20,6 +20,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; @@ -460,11 +461,7 @@ public class ArithmeticTest extends JexlTestCase { private static final double EPSILON = 1.e-6; private static void assertArithmeticException(final java.util.function.Supplier<Object> fun) { - try { - assertNull(fun.get()); - } catch (final ArithmeticException xany) { - assertNotNull(xany); - } + assertThrows(ArithmeticException.class, fun::get); } private static void assertNullOperand(final java.util.function.Supplier<Object> fun) {
