diff --git a/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/GeneratedResourceBuildItemTest.java b/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/GeneratedResourceBuildItemTest.java index 4a2ff352966e7..85c75b637ca23 100644 --- a/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/GeneratedResourceBuildItemTest.java +++ b/integration-tests/test-extension/extension/deployment/src/test/java/io/quarkus/deployment/pkg/builditem/GeneratedResourceBuildItemTest.java @@ -6,11 +6,14 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.net.InetAddress; import java.net.URL; +import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.List; +import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -35,7 +38,8 @@ class GeneratedResourceBuildItemTest { Dependency.of("org.apache.cxf", "cxf-rt-bindings-soap", "3.4.3"))); @Test - public void testXMLResourceWasMerged() throws IOException { + public void testXMLResourceWasMerged() { + Assumptions.assumeTrue(isOnline()); assertThat(runner.getStartupConsoleOutput()).contains("RESOURCES: 1", "org.apache.cxf.binding.xml.wsdl11.HttpAddressPlugin", "org.apache.cxf.binding.xml.wsdl11.XmlBindingPlugin", @@ -58,4 +62,13 @@ public static void main(String[] args) throws IOException { } } } + + boolean isOnline() { + try { + InetAddress resolved = InetAddress.getByName("sun.com"); + return resolved != null; + } catch (UnknownHostException e) { + return false; + } + } }