Detect Failure or Error of Junit Test in @After method September 24, 2023 by Tarik If you are lucky enough to be using JUnit 4.9 or later, TestWatcher will do exactly what you want. Share and Enjoy!