diff --git a/README.md b/README.md index bf7b0d9dca48..231460b04e76 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ Therefore, we have a total of 17 profiles: | integration-jdk24 | JDK24 projects | *IntegrationTest | | default-jdk25 | JDK25 projects | *UnitTest | | integration-jdk25 | JDK25 projects | *IntegrationTest | +| default-jdk26 | JDK26 projects | *UnitTest | +| integration-jdk26 | JDK26 projects | *IntegrationTest | | default-heavy | Heavy/long running projects | *UnitTest | | integration-heavy | Heavy/long running projects | *IntegrationTest | | default-jdk8 | JDK8 projects | *UnitTest | diff --git a/core-java-modules/core-java-11/src/test/java/com/baeldung/java11/httpclient/test/HttpClientUnitTest.java b/core-java-modules/core-java-11/src/test/java/com/baeldung/java11/httpclient/test/HttpClientUnitTest.java index 67dd4e612793..23b5aa1e4728 100644 --- a/core-java-modules/core-java-11/src/test/java/com/baeldung/java11/httpclient/test/HttpClientUnitTest.java +++ b/core-java-modules/core-java-11/src/test/java/com/baeldung/java11/httpclient/test/HttpClientUnitTest.java @@ -57,6 +57,7 @@ public void shouldNotFollowRedirectWhenSetToDefaultNever() throws IOException, I HttpRequest request = HttpRequest.newBuilder() .uri(new URI("http://stackoverflow.com")) .version(HttpClient.Version.HTTP_1_1) + .header("User-Agent", "Mozilla/5.0") .GET() .build(); HttpResponse response = HttpClient.newBuilder() @@ -70,7 +71,7 @@ public void shouldNotFollowRedirectWhenSetToDefaultNever() throws IOException, I @Test public void shouldFollowRedirectWhenSetToAlways() throws IOException, InterruptedException, URISyntaxException { HttpRequest request = HttpRequest.newBuilder() - .uri(new URI("http://stackoverflow.com")) + .uri(new URI("https://postman-echo.com/redirect-to?url=https://postman-echo.com/get")) .version(HttpClient.Version.HTTP_1_1) .GET() .build(); @@ -82,7 +83,7 @@ public void shouldFollowRedirectWhenSetToAlways() throws IOException, Interrupte assertThat(response.statusCode(), equalTo(HttpURLConnection.HTTP_OK)); assertThat(response.request() .uri() - .toString(), equalTo("https://stackoverflow.com/questions")); + .toString(), equalTo("https://postman-echo.com/get")); } @Test diff --git a/core-java-modules/core-java-11/src/test/java/com/baeldung/java11/httpclient/test/HttpRequestUnitTest.java b/core-java-modules/core-java-11/src/test/java/com/baeldung/java11/httpclient/test/HttpRequestUnitTest.java index 21bd04236871..1648969c5a72 100644 --- a/core-java-modules/core-java-11/src/test/java/com/baeldung/java11/httpclient/test/HttpRequestUnitTest.java +++ b/core-java-modules/core-java-11/src/test/java/com/baeldung/java11/httpclient/test/HttpRequestUnitTest.java @@ -38,7 +38,7 @@ public void shouldReturnStatusOKWhenSendGetRequest() throws IOException, Interru @Test public void shouldUseHttp2WhenWebsiteUsesHttp2() throws IOException, InterruptedException, URISyntaxException { HttpRequest request = HttpRequest.newBuilder() - .uri(new URI("https://stackoverflow.com/questions")) + .uri(new URI("https://www.baeldung.com")) .version(HttpClient.Version.HTTP_2) .GET() .build(); diff --git a/core-java-modules/core-java-11/src/test/java/com/baeldung/java11/httpclient/test/HttpResponseUnitTest.java b/core-java-modules/core-java-11/src/test/java/com/baeldung/java11/httpclient/test/HttpResponseUnitTest.java index 093b5389b6e4..08b7f88fc8f2 100644 --- a/core-java-modules/core-java-11/src/test/java/com/baeldung/java11/httpclient/test/HttpResponseUnitTest.java +++ b/core-java-modules/core-java-11/src/test/java/com/baeldung/java11/httpclient/test/HttpResponseUnitTest.java @@ -36,7 +36,7 @@ public void shouldReturnStatusOKWhenSendGetRequest() throws IOException, Interru @Test public void shouldResponseURIDifferentThanRequestURIWhenRedirect() throws IOException, InterruptedException, URISyntaxException { HttpRequest request = HttpRequest.newBuilder() - .uri(new URI("http://stackoverflow.com")) + .uri(new URI("http://postman-echo.com/redirect-to?url=https://postman-echo.com/get")) .version(HttpClient.Version.HTTP_2) .GET() .build(); @@ -46,9 +46,9 @@ public void shouldResponseURIDifferentThanRequestURIWhenRedirect() throws IOExce .send(request, HttpResponse.BodyHandlers.ofString()); assertThat(request.uri() - .toString(), equalTo("http://stackoverflow.com")); + .toString(), equalTo("http://postman-echo.com/redirect-to?url=https://postman-echo.com/get")); assertThat(response.uri() - .toString(), equalTo("https://stackoverflow.com/questions")); + .toString(), equalTo("https://postman-echo.com/get")); } } diff --git a/pom.xml b/pom.xml index 9c156bc682d8..295a443236f2 100644 --- a/pom.xml +++ b/pom.xml @@ -1018,6 +1018,48 @@ + + default-jdk26 + + + + org.apache.maven.plugins + maven-surefire-plugin + + 3 + true + + SpringContextTest + **/*UnitTest + + + **/*IntegrationTest.java + **/*IntTest.java + **/*LongRunningUnitTest.java + **/*ManualTest.java + **/JdbcTest.java + **/*LiveTest.java + + + + + + + + + + + + UTF-8 + 26 + 26 + 26 + 3.26.0 + + + + + integration-jdk17 @@ -1478,6 +1520,43 @@ + + integration-jdk26 + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + **/*ManualTest.java + **/*LiveTest.java + + + **/*IntegrationTest.java + **/*IntTest.java + + + + + + + + + + + + UTF-8 + 26 + 26 + 26 + 3.26.0 + + + + + live-all