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 f10c4b6938ef76fb5acde88245ae52991e468a65
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Jun 1 18:51:41 2024 -0400

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

diff --git a/src/test/java/org/apache/commons/jexl3/MapLiteralTest.java 
b/src/test/java/org/apache/commons/jexl3/MapLiteralTest.java
index cd9a9b30..e7d9e635 100644
--- a/src/test/java/org/apache/commons/jexl3/MapLiteralTest.java
+++ b/src/test/java/org/apache/commons/jexl3/MapLiteralTest.java
@@ -19,6 +19,7 @@ package org.apache.commons.jexl3;
 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.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
 
@@ -125,12 +126,7 @@ public class MapLiteralTest extends JexlTestCase {
             final Object o = e.evaluate(null);
             assertEquals(Collections.singletonMap("foo", "bar"), o);
         }
-        try {
-            final Object ff = JEXL.createExpression("{  : , }");
-            fail(ff.toString());
-        } catch(final JexlException.Parsing parsing) {
-            assertNotNull(parsing);
-        }
+        assertThrows(JexlException.Parsing.class, () -> 
JEXL.createExpression("{  : , }"));
     }
 
     @Test

Reply via email to