How can I run a function or a wrap-up code after a test failed in JUnit 5?
This can be done using TestWatcher in JUnit 5. On JUnit 4 however, you can use ErrorCollector.
This answer brilliantly provides a solution to the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With