I am writing some JUnit tests that verify that an exception of type MyCustomException is thrown. However, this exception is wrapped in other exceptions a number of
MyCustomException
You can use ExceptionUtils.hasCause(ex, type).
ExceptionUtils.hasCause(ex, type)