You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/06/01 23:28:50 UTC
(commons-jexl) 30/40: Use assertThrows()
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 8528b0c78832eaf9750f632a6a3b08b8f67b6232
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jun 1 18:49:09 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 5f3e5096..978b20d2 100644
--- a/src/test/java/org/apache/commons/jexl3/LexicalTest.java
+++ b/src/test/java/org/apache/commons/jexl3/LexicalTest.java
@@ -942,12 +942,8 @@ public class LexicalTest {
final JexlEngine jexl = new JexlBuilder().strict(false).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