Unless you explicitly state that you are expecting an exception, JUnit will automatically skip any tests that throw non-displayable exceptions.
For example, the following test will fail:
@Test public void exampleTest(){ throw new RuntimeException(); }
If you want to verify that the test fails in Exception, you can simply add throw new RuntimeException(); to the method you want to test, run the tests and check if they worked.
If you do not manually catch the exception and fail the test, JUnit will include the complete stack path in the error message, which will allow you to quickly find the source of the exception.
source share