diff --git a/http/http-static/src/test/java/io/quarkus/ts/httpstatic/LargeStaticResourceIT.java b/http/http-static/src/test/java/io/quarkus/ts/httpstatic/LargeStaticResourceIT.java index d1d211cda..09295a342 100644 --- a/http/http-static/src/test/java/io/quarkus/ts/httpstatic/LargeStaticResourceIT.java +++ b/http/http-static/src/test/java/io/quarkus/ts/httpstatic/LargeStaticResourceIT.java @@ -5,7 +5,7 @@ import java.io.IOException; import java.net.HttpURLConnection; -import java.net.URL; +import java.net.URI; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -27,8 +27,8 @@ public void testMainPageAvailability() { @Test public void testBigFileAvailability() throws IOException { - URL bigFileURL = new URL(RestAssured.baseURI + ":" + RestAssured.port + "/big-file"); - HttpURLConnection connection = (HttpURLConnection) bigFileURL.openConnection(); + URI bigFileURL = URI.create(RestAssured.baseURI + ":" + RestAssured.port + "/big-file"); + HttpURLConnection connection = (HttpURLConnection) bigFileURL.toURL().openConnection(); connection.setRequestMethod("HEAD"); connection.setConnectTimeout(TWO_SECONDS); connection.connect(); diff --git a/qute/reactive/src/main/java/io/quarkus/ts/qute/Application.java b/qute/reactive/src/main/java/io/quarkus/ts/qute/Application.java index 48d79fe3c..b82c8ca2f 100644 --- a/qute/reactive/src/main/java/io/quarkus/ts/qute/Application.java +++ b/qute/reactive/src/main/java/io/quarkus/ts/qute/Application.java @@ -1,9 +1,7 @@ package io.quarkus.ts.qute; -import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; -import java.net.URL; import java.util.HashMap; import java.util.Locale; import java.util.Map; @@ -222,8 +220,8 @@ private static URI getUri(String path) { final String host = system.getValue("quarkus.http.host", String.class); final Integer port = system.getValue("quarkus.http.port", Integer.class); try { - return new URL("http", host, port, path).toURI(); - } catch (URISyntaxException | MalformedURLException e) { + return new URI("http", null, host, port, path, null, null); + } catch (URISyntaxException e) { throw new RuntimeException(e); } } diff --git a/qute/synchronous/src/main/java/io/quarkus/ts/qute/Application.java b/qute/synchronous/src/main/java/io/quarkus/ts/qute/Application.java index 20be6080e..ffaad84d3 100644 --- a/qute/synchronous/src/main/java/io/quarkus/ts/qute/Application.java +++ b/qute/synchronous/src/main/java/io/quarkus/ts/qute/Application.java @@ -1,9 +1,7 @@ package io.quarkus.ts.qute; -import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; -import java.net.URL; import java.util.HashMap; import java.util.Locale; import java.util.Map; @@ -216,8 +214,8 @@ private static URI getUri(String path) { final String host = system.getValue("quarkus.http.host", String.class); final Integer port = system.getValue("quarkus.http.port", Integer.class); try { - return new URL("http", host, port, path).toURI(); - } catch (URISyntaxException | MalformedURLException e) { + return new URI("http", null, host, port, path, null, null); + } catch (URISyntaxException e) { throw new RuntimeException(e); } }