org.springframework.util.Assert shows in my surefire reports as an error, when in fact it should be a failure-Collection of common programming errors
You are using the wrong Assert class in your unit tests:
-
the
org.junit.Assertclass is for use in unit tests -
the
org.springframework.util.Assertclass is for use in runtime code.
And the practical difference is that they throw different exceptions.
If your unit test is testing whether (say) your bean’s afterPropertiesSet() method is calling org.springframework.util.Assert correctly, then this is not a simple JUnit style assertion. Rather, it is a test that IllegalArgumentException is being thrown, and should be tested in the same way that you would test for (say) IOException being thrown at the appropriate point.