Disable network access during Maven test runs

Viewed 149

I'm trying to improve our unit tests by making sure our Jenkins builds fail if the tests try to make outbound network calls (indicating mocking was not done). I can't find a way to disable network connections in Java, JUnit, Maven, Surefire, Jenkins, or any other part of the process. Is there a way to do this? Preferably as something we can enable for new projects (so we don't make all of our old stuff unbuildable).

0 Answers
Related