What’s the difference between failure and error in JUnit?

Failures are when your test cases fail – i.e. your assertions are incorrect.

Errors are when unexpected errors/exceptions occur – i.e. while trying to actually run the test and an unexpected exception is thrown like FileNotFound, etc`.

Leave a Comment