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 477a9b6ac85f68f511e1a9e20d5654307e989d3c
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Jun 1 13:59:02 2024 -0400

    Use assertThrows()
---
 src/test/java/org/apache/commons/jexl3/ArithmeticTest.java | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java 
b/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java
index c24786df..d1b229b7 100644
--- a/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java
+++ b/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java
@@ -753,13 +753,8 @@ public class ArithmeticTest extends JexlTestCase {
         result = script.execute(jc, new Var(15), new Var(3155));
         assertFalse((Boolean) result);
 
-        script = jexl.createScript("(x)->{ !x }");
-        try {
-            result = script.execute(jc, new Var(-42));
-            fail("should fail");
-        } catch (final JexlException xany) {
-            assertTrue(xany instanceof JexlException.Operator);
-        }
+        final JexlScript script1 = jexl.createScript("(x)->{ !x }");
+        assertThrows(JexlException.Operator.class, () -> script1.execute(jc, 
new Var(-42)));
     }
 
     @BeforeEach

Reply via email to