I have designed a small test case class that is designed to make mocking easier (in this case, with JUnit 4 and EasyMock). Part of this is verifying the mocks after the test has finished, so the mocks are verified in a method annotated with @After.
However, if there is a failure in the test method itself, which causes the test not to be completed and the mock verification to fail, the failure reported by JUnit is the failure of verification. However, it would be more useful if the failure reported was the failure in the test itself.
So, is there a way in JUnit to make sure that errors/failures in the test method are always displayed in preference to errors/failures that arise in methods annotated with @After?