Skip to content

Commit 40f35a4

Browse files
Avoid the deprecated URL constructor in the netty observation test
The core modules compile with -Werror, and URL(String) is deprecated as of Java 20, so the test failed to compile on the JDK 25 build agents and took the whole build down with it.
1 parent af2601b commit 40f35a4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎sdk/core/azure-core-http-netty/src/test/java/com/azure/core/http/netty/NettyExpectContinueObservationTests.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.io.OutputStream;
1919
import java.net.ServerSocket;
2020
import java.net.Socket;
21+
import java.net.URI;
2122
import java.net.URL;
2223
import java.nio.charset.StandardCharsets;
2324
import java.util.Locale;
@@ -92,7 +93,7 @@ private static final class ContinueTestServer implements AutoCloseable {
9293
}
9394

9495
URL url() throws IOException {
95-
return new URL("http://localhost:" + serverSocket.getLocalPort() + "/resource");
96+
return URI.create("http://localhost:" + serverSocket.getLocalPort() + "/resource").toURL();
9697
}
9798

9899
void start() {

0 commit comments

Comments
 (0)