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; } 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);