Why won't IntelliJ IDEA stop in debug mode when an assertion is triggered? I get a java.lang.AssertionError to console, but the running code doesn't pause at it as it is supposed to. Here are my exception breakpoints settings:

Why won't IntelliJ IDEA stop in debug mode when an assertion is triggered? I get a java.lang.AssertionError to console, but the running code doesn't pause at it as it is supposed to. Here are my exception breakpoints settings:

I found out that somehow debugger doesn't stop on assertions when running tests, but it does stop when running other code. The code I was trying to make stop on a failed assertion in debug mode was a test. That seems to be the issue, but I don't understand why would IDE behave that way.
What worked for me is explicitly adding and enabling the java.lang.AssertionError in the Java Exception Breakpoints category in the Breakpoints settings window.
Go to Run -> View Breakpoints, in the Breakpoints window click the plus + from the top left corner. From the drop down list, select Java Exception Breakpoints
In the Enter Exception class dialog, type java.lang.AssertionError and click OK
The java.lang.AssertionError will now show up in the Breakpoints window under the Java Exception Breakpoints category. Tick the box to enable it and further edit options for this exception. Click Done.