Can I configure Intellij Idea to break when a JUnit AssertionError error occurs?

Is it possible to configure Intellij Idea to break when JUnit java.lang.AssertionError occurs during debugging?

I know that Intellij Idea supports the ability to break when exceptions occur during debugging, but I'm not sure if this is possible for AssertionErrors.

This would be especially useful when a large application context needs to be prepared before unit tests are run.

I searched, but could not find the answer to this question.

Here's how my Run> View Breakpoints is configured ...> Java Breakpoints Configuration:

enter image description here

+8
java intellij-idea junit
source share
1 answer

In the Breakpoints dialog box, click the + button to add a new breakpoint, select Java Breakpoints from the drop-down list, and then enter java.lang.AssertionError as the exception class.

+15
source share

All Articles