Some of my unit/integration tests depend on external network resources. I understand that it's bad design, but sometimes it happens. I don't want these tests to fail when the build is running on a computer without Internet access (in the airplane, for example). I want these tests to be skipped like this:
class FooTest {
@BeforeAll
public static void skipIfOffline() {
Assumptions.assumeTrue(WeAreOnline.check());
}
}
Are you aware of such WeAreOnline
class somewhere in some Maven dependency, which I can reuse instead of implementing it over and over again in each project?