Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Intellij Idea be configured to break when a JUnit AssertionError occurs?

Can Intellij Idea be configured to break when a JUnit java.lang.AssertionError occurs during debugging?

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

This would be particularly useful when a large application context must be prepared before unit tests can be ran.

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

Here is how my Run > View Breakpoints... > Java Exception Breakpoints dialog is configured:

enter image description here

like image 890
Dan Torrey Avatar asked May 30 '14 13:05

Dan Torrey


1 Answers

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

like image 134
Mike Strobel Avatar answered Oct 16 '22 15:10

Mike Strobel