From 6ea4e39087cca04ecb57385acd6c8d8f699186b9 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 2 Jul 2023 20:19:07 -0400 Subject: [PATCH] Add tests for custom Throwable subclass --- .../commons/lang3/exception/ExceptionUtilsTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java b/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java index e8a4652f0ad..956a72390c1 100644 --- a/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/exception/ExceptionUtilsTest.java @@ -630,6 +630,11 @@ public void testIsChecked_unchecked() { assertFalse(ExceptionUtils.isChecked(new IllegalArgumentException())); } + @Test + public void testIsCheckedCustomThrowable() { + assertTrue(ExceptionUtils.isChecked(new TestThrowable())); + } + @Test public void testIsUnchecked_checked() { assertFalse(ExceptionUtils.isUnchecked(new IOException())); @@ -645,6 +650,11 @@ public void testIsUnchecked_unchecked() { assertTrue(ExceptionUtils.isUnchecked(new IllegalArgumentException())); } + @Test + public void testIsUnCheckedCustomThrowable() { + assertFalse(ExceptionUtils.isUnchecked(new TestThrowable())); + } + @Test public void testPrintRootCauseStackTrace_Throwable() { ExceptionUtils.printRootCauseStackTrace(null);