Add tests for custom Throwable subclass

This commit is contained in:
Gary Gregory 2023-07-02 20:19:07 -04:00
parent bbf5714b5a
commit 6ea4e39087
1 changed files with 10 additions and 0 deletions

View File

@ -630,6 +630,11 @@ public class ExceptionUtilsTest extends AbstractLangTest {
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 class ExceptionUtilsTest extends AbstractLangTest {
assertTrue(ExceptionUtils.isUnchecked(new IllegalArgumentException()));
}
@Test
public void testIsUnCheckedCustomThrowable() {
assertFalse(ExceptionUtils.isUnchecked(new TestThrowable()));
}
@Test
public void testPrintRootCauseStackTrace_Throwable() {
ExceptionUtils.printRootCauseStackTrace(null);