In the absence of a concrete solution, my answer is pretty general:
Such code smells (for example, exceptions for unwinding) are best cleared step by step (class by class) when you encounter them when fixing an outdated system. Code quality tools (such as Findbugs, PMD, Checkstyle, or Sonar Quality Server) help you find these things.
The way to "catch" swallowed exceptions automatically is to use the AspectJ compiler. You can declare aspects to generate compile-time errors in your IDE if you violate certain code conventions. Alternatively, you can twist during the execution of the tested classes and let AspectJ reconstruct such exceptions so that they can be written by the JUnit runner.
mhaller
source share