From 9b81b87bfbfed394a0be1e39a4833daae35c40cf Mon Sep 17 00:00:00 2001 From: Anuran Saikia <77756834+nuuron@users.noreply.github.com> Date: Tue, 29 Apr 2025 00:30:13 +0530 Subject: [PATCH 1/2] Update LocalHostUriTemplateHandler.java Signed-off-by: Anuran Saikia <77756834+nuuron@users.noreply.github.com> --- .../boot/test/web/client/LocalHostUriTemplateHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/LocalHostUriTemplateHandler.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/LocalHostUriTemplateHandler.java index 41ab878c721f..95a7f657af57 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/LocalHostUriTemplateHandler.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/client/LocalHostUriTemplateHandler.java @@ -81,7 +81,7 @@ public LocalHostUriTemplateHandler(Environment environment, String scheme, UriTe @Override public String getRootUri() { String port = this.environment.getProperty("local.server.port", "8080"); - String contextPath = this.environment.getProperty(PREFIX + "context-path", ""); + String contextPath = this.environment.getProperty(PREFIX + "context-path-edited", ""); return this.scheme + "://localhost:" + port + contextPath; } From 922e49575400c6f50b3f26eb2526132298bab503 Mon Sep 17 00:00:00 2001 From: Anuran Saikia <77756834+nuuron@users.noreply.github.com> Date: Tue, 29 Apr 2025 00:40:05 +0530 Subject: [PATCH 2/2] Update LocalHostWebClient.java Signed-off-by: Anuran Saikia <77756834+nuuron@users.noreply.github.com> --- .../boot/test/web/htmlunit/LocalHostWebClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClient.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClient.java index dbc2cd2d35f7..739804c5db13 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClient.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClient.java @@ -44,7 +44,7 @@ public LocalHostWebClient(Environment environment) { @Override public
P getPage(String url) throws IOException, FailingHttpStatusCodeException { if (url.startsWith("/")) { - String port = this.environment.getProperty("local.server.port", "8080"); + String port = this.environment.getProperty("local.server.port", "8081"); url = "http://localhost:" + port + url; } return super.getPage(url);