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 1727dc8c2ffe2a4625e4e12294e4c885227a7006
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Jun 1 18:48:52 2024 -0400

    Use assertThrows()
---
 src/test/java/org/apache/commons/jexl3/LexicalTest.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/commons/jexl3/LexicalTest.java 
b/src/test/java/org/apache/commons/jexl3/LexicalTest.java
index 17a83066..5f3e5096 100644
--- a/src/test/java/org/apache/commons/jexl3/LexicalTest.java
+++ b/src/test/java/org/apache/commons/jexl3/LexicalTest.java
@@ -832,12 +832,8 @@ public class LexicalTest {
         final JexlEngine jexl = new 
JexlBuilder().strict(true).lexical(true).lexicalShade(true).create();
         final JexlScript e = jexl.createScript(str);
         final JexlContext ctxt = new MapContext();
-        try {
-            final Object o = e.execute(ctxt);
-            fail("i should be shaded");
-        } catch (final JexlException xany) {
-            assertNotNull(xany);
-        }
+        JexlException  xany = assertThrows(JexlException.class, () -> 
e.execute(ctxt), "i should be shaded");
+        assertNotNull(xany.toString());
     }
 
     @Test public void testManyConst() {

Reply via email to