Issue
How can I run a function or a wrap-up code after a test failed in JUnit 5?
Solution
This can be done using rel="nofollow noreferrer">TestWatcher in JUnit 5. On JUnit 4 however, you can use ErrorCollector.
This answer brilliantly provides a solution to for the problem.
Answered By - Bat
Answer Checked By - Cary Denson (JavaFixing Admin)