diff --git a/.gitignore b/.gitignore
index ef7d5b97a97..0ffbd5a9ae1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ target/
.project
.factorypath
.apt_generated/
+.checkstyle
# Intellij
.idea/
diff --git a/pom.xml b/pom.xml
index e2ca344d44e..f723c6ae129 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,10 +30,10 @@
https://github.com/codecentric/spring-boot-admin/
- 3.5.2-SNAPSHOT
+ 3.5.6-springboot4-SNAPSHOT
17
- v22.12.0
+ v22.14.0
3.9
@@ -44,10 +44,10 @@
UTF-8
- 3.5.4
- 2025.0.0
+ 4.0.0-M3
+ 2025.1.0-M2
- 2.3.0
+ 2.3.1-springboot4-SNAPSHOT
10.26.1
3.0.2
diff --git a/spring-boot-admin-client/pom.xml b/spring-boot-admin-client/pom.xml
index 1a5334c620f..fa2a7af4c3d 100644
--- a/spring-boot-admin-client/pom.xml
+++ b/spring-boot-admin-client/pom.xml
@@ -44,11 +44,26 @@
org.springframework
spring-web
+
+ org.springframework.boot
+ spring-boot-restclient
+ true
+
+
+ org.springframework.boot
+ spring-boot-webclient
+ true
+
org.springframework.boot
spring-boot-starter-web
true
+
+ org.springframework.boot
+ spring-boot-starter-webflux
+ true
+
org.springframework.boot
spring-boot-autoconfigure-processor
@@ -64,6 +79,10 @@
spring-webflux
true
+
+ com.google.code.findbugs
+ jsr305
+
org.projectlombok
lombok
@@ -74,11 +93,6 @@
spring-boot-starter-test
test
-
- org.springframework.boot
- spring-boot-starter-webflux
- test
-
org.wiremock
wiremock-standalone
@@ -89,5 +103,10 @@
awaitility
test
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ test
+
diff --git a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/ClientRuntimeHints.java b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/ClientRuntimeHints.java
index b8f5ffaf2f8..67d4efea819 100644
--- a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/ClientRuntimeHints.java
+++ b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/ClientRuntimeHints.java
@@ -21,7 +21,7 @@
import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
-import org.springframework.boot.web.context.WebServerInitializedEvent;
+import org.springframework.boot.web.server.context.WebServerInitializedEvent;
import org.springframework.context.annotation.Configuration;
import de.codecentric.boot.admin.client.registration.Application;
diff --git a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfiguration.java b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfiguration.java
index 1c361bf02dd..c68479daf99 100644
--- a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfiguration.java
+++ b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfiguration.java
@@ -29,17 +29,18 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
-import org.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties;
-import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder;
import org.springframework.boot.http.client.ClientHttpRequestFactorySettings;
-import org.springframework.boot.web.client.RestTemplateBuilder;
+import org.springframework.boot.restclient.RestTemplateBuilder;
+import org.springframework.boot.restclient.autoconfigure.RestClientAutoConfiguration;
+import org.springframework.boot.restclient.autoconfigure.RestTemplateAutoConfiguration;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
+import org.springframework.boot.webclient.autoconfigure.WebClientAutoConfiguration;
+import org.springframework.boot.webflux.autoconfigure.WebFluxProperties;
+import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
+import org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
@@ -64,7 +65,6 @@
import de.codecentric.boot.admin.client.registration.metadata.MetadataContributor;
import de.codecentric.boot.admin.client.registration.metadata.StartupDateMetadataContributor;
-import static org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import static org.springframework.web.reactive.function.client.ExchangeFilterFunctions.basicAuthentication;
@Configuration(proxyBeanMethods = false)
diff --git a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfiguration.java b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfiguration.java
index a9326ab20fd..1e062e30bb5 100644
--- a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfiguration.java
+++ b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfiguration.java
@@ -27,9 +27,9 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnCloudPlatform;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.boot.cloud.CloudPlatform;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
diff --git a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringNativeClientAutoConfiguration.java b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringNativeClientAutoConfiguration.java
index 198a9a2a843..63d9fd86009 100644
--- a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringNativeClientAutoConfiguration.java
+++ b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/config/SpringNativeClientAutoConfiguration.java
@@ -19,8 +19,8 @@
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration;
+import org.springframework.boot.restclient.autoconfigure.RestTemplateAutoConfiguration;
+import org.springframework.boot.webclient.autoconfigure.WebClientAutoConfiguration;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportRuntimeHints;
diff --git a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactory.java b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactory.java
index bdab8c466ea..07f337fb1c0 100644
--- a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactory.java
+++ b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactory.java
@@ -19,7 +19,7 @@
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
import org.springframework.util.StringUtils;
import de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties;
diff --git a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/DefaultApplicationFactory.java b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/DefaultApplicationFactory.java
index 08432f83f77..e6a90c3e68e 100644
--- a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/DefaultApplicationFactory.java
+++ b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/DefaultApplicationFactory.java
@@ -25,9 +25,9 @@
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
-import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.boot.web.server.Ssl;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
+import org.springframework.boot.web.server.context.WebServerInitializedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.lang.Nullable;
import org.springframework.util.StringUtils;
@@ -162,7 +162,7 @@ protected String getHealthUrl() {
if (this.instance.getHealthUrl() != null) {
return this.instance.getHealthUrl();
}
- return UriComponentsBuilder.fromHttpUrl(getManagementBaseUrl())
+ return UriComponentsBuilder.fromUriString(getManagementBaseUrl())
.path("/")
.path(getHealthEndpointPath())
.toUriString();
diff --git a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/ReactiveApplicationFactory.java b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/ReactiveApplicationFactory.java
index 1c65f63d2f2..6dd86c18440 100644
--- a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/ReactiveApplicationFactory.java
+++ b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/ReactiveApplicationFactory.java
@@ -19,9 +19,9 @@
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
-import org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties;
import org.springframework.boot.web.server.Ssl;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
+import org.springframework.boot.webflux.autoconfigure.WebFluxProperties;
import org.springframework.util.StringUtils;
import org.springframework.web.util.UriComponentsBuilder;
diff --git a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/ServletApplicationFactory.java b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/ServletApplicationFactory.java
index 171c794fc9a..d4609efb55e 100644
--- a/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/ServletApplicationFactory.java
+++ b/spring-boot-admin-client/src/main/java/de/codecentric/boot/admin/client/registration/ServletApplicationFactory.java
@@ -20,9 +20,9 @@
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
-import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath;
import org.springframework.boot.web.server.Ssl;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
+import org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath;
import org.springframework.util.StringUtils;
import org.springframework.web.util.UriComponentsBuilder;
@@ -55,8 +55,8 @@ public ServletApplicationFactory(InstanceProperties instance, ManagementServerPr
@Override
protected String getServiceUrl() {
- if (instance.getServiceUrl() != null) {
- return instance.getServiceUrl();
+ if (this.instance.getServiceUrl() != null) {
+ return this.instance.getServiceUrl();
}
return UriComponentsBuilder.fromUriString(getServiceBaseUrl())
@@ -67,21 +67,21 @@ protected String getServiceUrl() {
@Override
protected String getManagementBaseUrl() {
- String baseUrl = instance.getManagementBaseUrl();
+ String baseUrl = this.instance.getManagementBaseUrl();
if (StringUtils.hasText(baseUrl)) {
return baseUrl;
}
if (isManagementPortEqual()) {
- return UriComponentsBuilder.fromHttpUrl(getServiceUrl())
+ return UriComponentsBuilder.fromUriString(getServiceUrl())
.path("/")
.path(getDispatcherServletPrefix())
.path(getManagementContextPath())
.toUriString();
}
- Ssl ssl = (management.getSsl() != null) ? management.getSsl() : server.getSsl();
+ Ssl ssl = (this.management.getSsl() != null) ? this.management.getSsl() : this.server.getSsl();
return UriComponentsBuilder.newInstance()
.scheme(getScheme(ssl))
.host(getManagementHost())
@@ -91,11 +91,11 @@ protected String getManagementBaseUrl() {
}
protected String getManagementContextPath() {
- return management.getBasePath();
+ return this.management.getBasePath();
}
protected String getServerContextPath() {
- return servletContext.getContextPath();
+ return this.servletContext.getContextPath();
}
protected String getDispatcherServletPrefix() {
diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/AbstractClientApplicationTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/AbstractClientApplicationTest.java
index 5c8ee56ca5f..15939e49dc8 100644
--- a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/AbstractClientApplicationTest.java
+++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/AbstractClientApplicationTest.java
@@ -17,16 +17,18 @@
package de.codecentric.boot.admin.client;
import java.net.InetAddress;
-import java.net.UnknownHostException;
import java.time.Duration;
import java.util.Arrays;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder;
import com.github.tomakehurst.wiremock.common.ConsoleNotifier;
import com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;
+import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -35,6 +37,7 @@
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.event.ApplicationReadyEvent;
+import org.springframework.boot.jackson.autoconfigure.JacksonProperties;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.event.EventListener;
@@ -50,6 +53,7 @@
import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options;
import static org.awaitility.Awaitility.await;
+@Slf4j
public abstract class AbstractClientApplicationTest {
private final WireMockServer wireMock = new WireMockServer(
@@ -67,39 +71,43 @@ protected void setUp(WebApplicationType type) {
}
private void setUpWiremock() {
- wireMock.start();
+ this.wireMock.start();
ResponseDefinitionBuilder response = created().withHeader("Content-Type", "application/json")
.withHeader("Connection", "close")
- .withHeader("Location", wireMock.url("/instances/abcdef"))
+ .withHeader("Location", this.wireMock.url("/instances/abcdef"))
.withBody("{ \"id\" : \"abcdef\" }");
- wireMock.stubFor(post(urlEqualTo("/instances")).willReturn(response));
+ this.wireMock.stubFor(post(urlEqualTo("/instances")).willReturn(response));
}
private void setUpApplication(WebApplicationType type) {
- application = new SpringApplication(TestClientApplication.class);
- application.setWebApplicationType(type);
+ this.application = new SpringApplication(TestClientApplication.class);
+ this.application.setWebApplicationType(type);
}
private void setUpApplicationContext(String... additionalArgs) {
Stream defaultArgs = Stream.of("--spring.application.name=Test-Client", "--server.port=0",
"--management.endpoints.web.base-path=/mgmt", "--endpoints.health.enabled=true",
- "--spring.boot.admin.client.url=" + wireMock.url("/"));
+ "--spring.boot.admin.client.url=" + this.wireMock.url("/"));
String[] args = Stream.concat(defaultArgs, Arrays.stream(additionalArgs)).toArray(String[]::new);
- this.instance = application.run(args);
+ this.instance = this.application.run(args);
}
@AfterEach
void tearDown() {
- wireMock.stop();
- if (instance != null) {
- instance.close();
+ this.wireMock.stop();
+ if (this.instance != null) {
+ this.instance.close();
}
}
+ /**
+ * @see JacksonProperties
+ * @see PropertyNamingStrategies#LOWER_CAMEL_CASE
+ */
@Test
- public void test_context() throws InterruptedException, UnknownHostException {
+ public void test_context() throws Exception {
setUpApplicationContext();
String hostName = InetAddress.getLocalHost().getCanonicalHostName();
@@ -113,12 +121,17 @@ public void test_context() throws InterruptedException, UnknownHostException {
.withRequestBody(matchingJsonPath("$.serviceUrl", equalTo(serviceHost + "/")))
.withRequestBody(matchingJsonPath("$.metadata.startup", matching(".+")));
- cdl.await();
- await().atMost(Duration.ofMillis(2500)).untilAsserted(() -> wireMock.verify(request));
+ log.info("Waiting for registration at mocked sba-server for '{}' ...", this.instance);
+ cdl.await(5_000, TimeUnit.MILLISECONDS);
+ await().atMost(Duration.ofMillis(2500)).untilAsserted(() -> this.wireMock.verify(request));
}
+ /**
+ * @see JacksonProperties
+ * @see PropertyNamingStrategies#SNAKE_CASE
+ */
@Test
- public void test_context_with_snake_case() throws InterruptedException, UnknownHostException {
+ public void test_context_with_snake_case() throws Exception {
setUpApplicationContext("--spring.jackson.property-naming-strategy=SNAKE_CASE");
String hostName = InetAddress.getLocalHost().getCanonicalHostName();
@@ -132,16 +145,17 @@ public void test_context_with_snake_case() throws InterruptedException, UnknownH
.withRequestBody(matchingJsonPath("$.service_url", equalTo(serviceHost + "/")))
.withRequestBody(matchingJsonPath("$.metadata.startup", matching(".+")));
- cdl.await();
- await().atMost(Duration.ofMillis(2500)).untilAsserted(() -> wireMock.verify(request));
+ log.info("Waiting for registration at mocked sba-server for '{}' ...", this.instance);
+ cdl.await(5_000, TimeUnit.MILLISECONDS);
+ await().atMost(Duration.ofMillis(2500)).untilAsserted(() -> this.wireMock.verify(request));
}
private int getServerPort() {
- return instance.getEnvironment().getProperty("local.server.port", Integer.class, 0);
+ return this.instance.getEnvironment().getProperty("local.server.port", Integer.class, 0);
}
private int getManagementPort() {
- return instance.getEnvironment().getProperty("local.management.port", Integer.class, 0);
+ return this.instance.getEnvironment().getProperty("local.management.port", Integer.class, 0);
}
@SpringBootConfiguration
@@ -154,7 +168,9 @@ public static class TestClientApplication {
@EventListener
public void ping(ApplicationReadyEvent ev) {
new Thread(() -> {
- await().atMost(Duration.ofMillis(500)).until(() -> registrator.getRegisteredId() != null);
+ log.info("Waiting for registration at mocked sba-server for '{}' ...", this);
+ await().atMost(Duration.ofMillis(3_500)).until(() -> this.registrator.getRegisteredId() != null);
+ log.info("Found registration id '{}' for '{}'", this.registrator.getRegisteredId(), this);
cdl.countDown();
}).start();
}
diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfigurationTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfigurationTest.java
index 8b53562256d..831d94ae2e6 100644
--- a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfigurationTest.java
+++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientAutoConfigurationTest.java
@@ -22,17 +22,17 @@
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.autoconfigure.http.client.HttpClientAutoConfiguration;
import org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener;
-import org.springframework.boot.autoconfigure.web.client.RestClientAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties;
-import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
import org.springframework.boot.context.annotation.UserConfigurations;
+import org.springframework.boot.http.client.autoconfigure.HttpClientAutoConfiguration;
+import org.springframework.boot.restclient.autoconfigure.RestClientAutoConfiguration;
+import org.springframework.boot.restclient.autoconfigure.RestTemplateAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
+import org.springframework.boot.webclient.autoconfigure.WebClientAutoConfiguration;
+import org.springframework.boot.webflux.autoconfigure.WebFluxProperties;
+import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.ClientHttpRequestFactory;
@@ -183,7 +183,7 @@ public static class CustomBlockingConfiguration {
@Bean
public RegistrationClient registrationClient() {
- return registrationClient;
+ return this.registrationClient;
}
}
diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfigurationTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfigurationTest.java
index 9dfc12b08f7..04009906de4 100644
--- a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfigurationTest.java
+++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientCloudFoundryAutoConfigurationTest.java
@@ -20,10 +20,10 @@
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
+import org.springframework.boot.restclient.autoconfigure.RestTemplateAutoConfiguration;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
+import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
+import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
import de.codecentric.boot.admin.client.registration.ApplicationFactory;
import de.codecentric.boot.admin.client.registration.CloudFoundryApplicationFactory;
diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientRegistrationClientAutoConfigurationTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientRegistrationClientAutoConfigurationTest.java
index cce6ba8086c..d012a44f018 100644
--- a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientRegistrationClientAutoConfigurationTest.java
+++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/config/SpringBootAdminClientRegistrationClientAutoConfigurationTest.java
@@ -26,10 +26,10 @@
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener;
-import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder;
+import org.springframework.boot.restclient.RestTemplateBuilder;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
-import org.springframework.boot.web.client.RestTemplateBuilder;
+import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
import org.springframework.web.client.RestClient;
import org.springframework.web.reactive.function.client.WebClient;
diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactoryTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactoryTest.java
index c0fcae7c33f..995e8868ab9 100644
--- a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactoryTest.java
+++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/CloudFoundryApplicationFactoryTest.java
@@ -23,7 +23,7 @@
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
import de.codecentric.boot.admin.client.config.CloudFoundryApplicationProperties;
import de.codecentric.boot.admin.client.config.InstanceProperties;
diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/DefaultApplicationFactoryTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/DefaultApplicationFactoryTest.java
index 512ac881273..bc698ac4ca7 100644
--- a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/DefaultApplicationFactoryTest.java
+++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/DefaultApplicationFactoryTest.java
@@ -25,11 +25,11 @@
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
-import org.springframework.boot.web.context.WebServerApplicationContext;
-import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.boot.web.server.Ssl;
import org.springframework.boot.web.server.WebServer;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
+import org.springframework.boot.web.server.context.WebServerApplicationContext;
+import org.springframework.boot.web.server.context.WebServerInitializedEvent;
import de.codecentric.boot.admin.client.config.InstanceProperties;
diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ReactiveApplicationFactoryTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ReactiveApplicationFactoryTest.java
index d27d768eb3c..bc6791f45cd 100644
--- a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ReactiveApplicationFactoryTest.java
+++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ReactiveApplicationFactoryTest.java
@@ -25,11 +25,11 @@
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
-import org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties;
-import org.springframework.boot.web.context.WebServerApplicationContext;
-import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.boot.web.server.WebServer;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
+import org.springframework.boot.web.server.context.WebServerApplicationContext;
+import org.springframework.boot.web.server.context.WebServerInitializedEvent;
+import org.springframework.boot.webflux.autoconfigure.WebFluxProperties;
import de.codecentric.boot.admin.client.config.InstanceProperties;
@@ -52,22 +52,23 @@ class ReactiveApplicationFactoryTest {
private final WebFluxProperties webflux = new WebFluxProperties();
- private final ReactiveApplicationFactory factory = new ReactiveApplicationFactory(instanceProperties, management,
- server, pathMappedEndpoints, webEndpoint, () -> singletonMap("contributor", "test"), webflux);
+ private final ReactiveApplicationFactory factory = new ReactiveApplicationFactory(this.instanceProperties,
+ this.management, this.server, this.pathMappedEndpoints, this.webEndpoint,
+ () -> singletonMap("contributor", "test"), this.webflux);
@BeforeEach
void setup() {
- instanceProperties.setName("test");
+ this.instanceProperties.setName("test");
}
@Test
void test_contextPath_mgmtPath() {
- webflux.setBasePath("/app");
- webEndpoint.setBasePath("/admin");
- when(pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/admin/health");
- publishApplicationReadyEvent(factory, 8080, null);
+ this.webflux.setBasePath("/app");
+ this.webEndpoint.setBasePath("/admin");
+ when(this.pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/admin/health");
+ publishApplicationReadyEvent(this.factory, 8080, null);
- Application app = factory.createApplication();
+ Application app = this.factory.createApplication();
assertThat(app.getManagementUrl()).isEqualTo("http://" + getHostname() + ":8080/app/admin");
assertThat(app.getHealthUrl()).isEqualTo("http://" + getHostname() + ":8080/app/admin/health");
assertThat(app.getServiceUrl()).isEqualTo("http://" + getHostname() + ":8080/app");
@@ -75,12 +76,12 @@ void test_contextPath_mgmtPath() {
@Test
void test_contextPath_mgmtPortPath() {
- webflux.setBasePath("/app");
- webEndpoint.setBasePath("/admin");
- when(pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/admin/health");
- publishApplicationReadyEvent(factory, 8080, 8081);
+ this.webflux.setBasePath("/app");
+ this.webEndpoint.setBasePath("/admin");
+ when(this.pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/admin/health");
+ publishApplicationReadyEvent(this.factory, 8080, 8081);
- Application app = factory.createApplication();
+ Application app = this.factory.createApplication();
assertThat(app.getManagementUrl()).isEqualTo("http://" + getHostname() + ":8081/admin");
assertThat(app.getHealthUrl()).isEqualTo("http://" + getHostname() + ":8081/admin/health");
assertThat(app.getServiceUrl()).isEqualTo("http://" + getHostname() + ":8080/app");
@@ -88,11 +89,11 @@ void test_contextPath_mgmtPortPath() {
@Test
void test_basePath() {
- webflux.setBasePath("/app");
- when(pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/actuator/health");
- publishApplicationReadyEvent(factory, 80, null);
+ this.webflux.setBasePath("/app");
+ when(this.pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/actuator/health");
+ publishApplicationReadyEvent(this.factory, 80, null);
- Application app = factory.createApplication();
+ Application app = this.factory.createApplication();
assertThat(app.getManagementUrl()).isEqualTo("http://" + getHostname() + ":80/app/actuator");
assertThat(app.getHealthUrl()).isEqualTo("http://" + getHostname() + ":80/app/actuator/health");
assertThat(app.getServiceUrl()).isEqualTo("http://" + getHostname() + ":80/app");
@@ -100,10 +101,10 @@ void test_basePath() {
@Test
void test_noBasePath() {
- when(pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/actuator/health");
- publishApplicationReadyEvent(factory, 80, null);
+ when(this.pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/actuator/health");
+ publishApplicationReadyEvent(this.factory, 80, null);
- Application app = factory.createApplication();
+ Application app = this.factory.createApplication();
assertThat(app.getManagementUrl()).isEqualTo("http://" + getHostname() + ":80/actuator");
assertThat(app.getHealthUrl()).isEqualTo("http://" + getHostname() + ":80/actuator/health");
assertThat(app.getServiceUrl()).isEqualTo("http://" + getHostname() + ":80/");
@@ -111,12 +112,12 @@ void test_noBasePath() {
@Test
void test_mgmtBasePath_mgmtPortPath() {
- webflux.setBasePath("/app");
- management.setBasePath("/mgnt");
- when(pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/actuator/health");
- publishApplicationReadyEvent(factory, 8080, 8081);
+ this.webflux.setBasePath("/app");
+ this.management.setBasePath("/mgnt");
+ when(this.pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/actuator/health");
+ publishApplicationReadyEvent(this.factory, 8080, 8081);
- Application app = factory.createApplication();
+ Application app = this.factory.createApplication();
assertThat(app.getManagementUrl()).isEqualTo("http://" + getHostname() + ":8081/mgnt/actuator");
assertThat(app.getHealthUrl()).isEqualTo("http://" + getHostname() + ":8081/mgnt/actuator/health");
assertThat(app.getServiceUrl()).isEqualTo("http://" + getHostname() + ":8080/app");
@@ -146,13 +147,13 @@ private static final class TestWebServerInitializedEvent extends WebServerInitia
private TestWebServerInitializedEvent(String name, int port) {
super(mock(WebServer.class));
- when(server.getPort()).thenReturn(port);
- when(context.getServerNamespace()).thenReturn(name);
+ when(this.server.getPort()).thenReturn(port);
+ when(this.context.getServerNamespace()).thenReturn(name);
}
@Override
public WebServerApplicationContext getApplicationContext() {
- return context;
+ return this.context;
}
@Override
diff --git a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ServletApplicationFactoryTest.java b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ServletApplicationFactoryTest.java
index 24351d67aef..288e60a72d1 100644
--- a/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ServletApplicationFactoryTest.java
+++ b/spring-boot-admin-client/src/test/java/de/codecentric/boot/admin/client/registration/ServletApplicationFactoryTest.java
@@ -26,11 +26,11 @@
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties;
import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
-import org.springframework.boot.autoconfigure.web.ServerProperties;
-import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath;
-import org.springframework.boot.web.context.WebServerApplicationContext;
-import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.boot.web.server.WebServer;
+import org.springframework.boot.web.server.autoconfigure.ServerProperties;
+import org.springframework.boot.web.server.context.WebServerApplicationContext;
+import org.springframework.boot.web.server.context.WebServerInitializedEvent;
+import org.springframework.boot.webmvc.autoconfigure.DispatcherServletPath;
import org.springframework.mock.web.MockServletContext;
import de.codecentric.boot.admin.client.config.InstanceProperties;
@@ -55,23 +55,24 @@ class ServletApplicationFactoryTest {
private final DispatcherServletPath dispatcherServletPath = mock(DispatcherServletPath.class);
- private final ServletApplicationFactory factory = new ServletApplicationFactory(instance, management, server,
- servletContext, pathMappedEndpoints, webEndpoint, Collections::emptyMap, dispatcherServletPath);
+ private final ServletApplicationFactory factory = new ServletApplicationFactory(this.instance, this.management,
+ this.server, this.servletContext, this.pathMappedEndpoints, this.webEndpoint, Collections::emptyMap,
+ this.dispatcherServletPath);
@BeforeEach
void setup() {
- instance.setName("test");
- when(dispatcherServletPath.getPrefix()).thenReturn("");
+ this.instance.setName("test");
+ when(this.dispatcherServletPath.getPrefix()).thenReturn("");
}
@Test
void test_contextPath_mgmtPath() {
- servletContext.setContextPath("app");
- webEndpoint.setBasePath("/admin");
- when(pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/admin/health");
- publishApplicationReadyEvent(factory, 8080, null);
+ this.servletContext.setContextPath("app");
+ this.webEndpoint.setBasePath("/admin");
+ when(this.pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/admin/health");
+ publishApplicationReadyEvent(this.factory, 8080, null);
- Application app = factory.createApplication();
+ Application app = this.factory.createApplication();
assertThat(app.getManagementUrl()).isEqualTo("http://" + getHostname() + ":8080/app/admin");
assertThat(app.getHealthUrl()).isEqualTo("http://" + getHostname() + ":8080/app/admin/health");
assertThat(app.getServiceUrl()).isEqualTo("http://" + getHostname() + ":8080/app");
@@ -79,12 +80,12 @@ void test_contextPath_mgmtPath() {
@Test
void test_contextPath_mgmtPortPath() {
- servletContext.setContextPath("app");
- webEndpoint.setBasePath("/admin");
- when(pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/admin/health");
- publishApplicationReadyEvent(factory, 8080, 8081);
+ this.servletContext.setContextPath("app");
+ this.webEndpoint.setBasePath("/admin");
+ when(this.pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/admin/health");
+ publishApplicationReadyEvent(this.factory, 8080, 8081);
- Application app = factory.createApplication();
+ Application app = this.factory.createApplication();
assertThat(app.getManagementUrl()).isEqualTo("http://" + getHostname() + ":8081/admin");
assertThat(app.getHealthUrl()).isEqualTo("http://" + getHostname() + ":8081/admin/health");
assertThat(app.getServiceUrl()).isEqualTo("http://" + getHostname() + ":8080/app");
@@ -92,11 +93,11 @@ void test_contextPath_mgmtPortPath() {
@Test
void test_contextPath() {
- servletContext.setContextPath("app");
- when(pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/actuator/health");
- publishApplicationReadyEvent(factory, 80, null);
+ this.servletContext.setContextPath("app");
+ when(this.pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/actuator/health");
+ publishApplicationReadyEvent(this.factory, 80, null);
- Application app = factory.createApplication();
+ Application app = this.factory.createApplication();
assertThat(app.getManagementUrl()).isEqualTo("http://" + getHostname() + ":80/app/actuator");
assertThat(app.getHealthUrl()).isEqualTo("http://" + getHostname() + ":80/app/actuator/health");
assertThat(app.getServiceUrl()).isEqualTo("http://" + getHostname() + ":80/app");
@@ -104,12 +105,12 @@ void test_contextPath() {
@Test
void test_servletPath() {
- when(dispatcherServletPath.getPrefix()).thenReturn("app");
- servletContext.setContextPath("srv");
- when(pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/actuator/health");
- publishApplicationReadyEvent(factory, 80, null);
+ when(this.dispatcherServletPath.getPrefix()).thenReturn("app");
+ this.servletContext.setContextPath("srv");
+ when(this.pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/actuator/health");
+ publishApplicationReadyEvent(this.factory, 80, null);
- Application app = factory.createApplication();
+ Application app = this.factory.createApplication();
assertThat(app.getManagementUrl()).isEqualTo("http://" + getHostname() + ":80/srv/app/actuator");
assertThat(app.getHealthUrl()).isEqualTo("http://" + getHostname() + ":80/srv/app/actuator/health");
assertThat(app.getServiceUrl()).isEqualTo("http://" + getHostname() + ":80/srv");
@@ -117,12 +118,12 @@ void test_servletPath() {
@Test
void test_servicePath() {
- servletContext.setContextPath("app");
- when(pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/actuator/health");
- publishApplicationReadyEvent(factory, 80, null);
- instance.setServicePath("/servicePath/");
+ this.servletContext.setContextPath("app");
+ when(this.pathMappedEndpoints.getPath(EndpointId.of("health"))).thenReturn("/actuator/health");
+ publishApplicationReadyEvent(this.factory, 80, null);
+ this.instance.setServicePath("/servicePath/");
- Application app = factory.createApplication();
+ Application app = this.factory.createApplication();
assertThat(app.getManagementUrl()).isEqualTo("http://" + getHostname() + ":80/servicePath/app/actuator");
assertThat(app.getHealthUrl()).isEqualTo("http://" + getHostname() + ":80/servicePath/app/actuator/health");
assertThat(app.getServiceUrl()).isEqualTo("http://" + getHostname() + ":80/servicePath/app");
@@ -152,13 +153,13 @@ private static final class TestWebServerInitializedEvent extends WebServerInitia
private TestWebServerInitializedEvent(String name, int port) {
super(mock(WebServer.class));
- when(server.getPort()).thenReturn(port);
- when(context.getServerNamespace()).thenReturn(name);
+ when(this.server.getPort()).thenReturn(port);
+ when(this.context.getServerNamespace()).thenReturn(name);
}
@Override
public WebServerApplicationContext getApplicationContext() {
- return context;
+ return this.context;
}
@Override
diff --git a/spring-boot-admin-samples/spring-boot-admin-sample-servlet/src/main/java/de/codecentric/boot/admin/sample/SecuritySecureConfig.java b/spring-boot-admin-samples/spring-boot-admin-sample-servlet/src/main/java/de/codecentric/boot/admin/sample/SecuritySecureConfig.java
index 46bd0144932..279ba3d7270 100644
--- a/spring-boot-admin-samples/spring-boot-admin-sample-servlet/src/main/java/de/codecentric/boot/admin/sample/SecuritySecureConfig.java
+++ b/spring-boot-admin-samples/spring-boot-admin-sample-servlet/src/main/java/de/codecentric/boot/admin/sample/SecuritySecureConfig.java
@@ -19,7 +19,7 @@
import java.util.UUID;
import jakarta.servlet.DispatcherType;
-import org.springframework.boot.autoconfigure.security.SecurityProperties;
+import org.springframework.boot.security.autoconfigure.SecurityProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
@@ -68,7 +68,8 @@ protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.requestMatchers(
PathPatternRequestMatcher.withDefaults().matcher((this.adminServer.path("/actuator/info"))))
.permitAll()
- .requestMatchers(PathPatternRequestMatcher.withDefaults().matcher(adminServer.path("/actuator/health")))
+ .requestMatchers(
+ PathPatternRequestMatcher.withDefaults().matcher(this.adminServer.path("/actuator/health")))
.permitAll()
.requestMatchers(PathPatternRequestMatcher.withDefaults().matcher(this.adminServer.path("/login")))
.permitAll()
diff --git a/spring-boot-admin-server-cloud/pom.xml b/spring-boot-admin-server-cloud/pom.xml
index a2beab77024..ba066e70dfc 100644
--- a/spring-boot-admin-server-cloud/pom.xml
+++ b/spring-boot-admin-server-cloud/pom.xml
@@ -104,6 +104,11 @@
spring-boot-starter-security
test
+
+ org.springframework.boot
+ spring-boot-starter-mail
+ test
+
com.fasterxml.jackson.datatype
jackson-datatype-json-org
@@ -114,5 +119,10 @@
reactor-test
test
+
+ org.springframework.boot
+ spring-boot-webclient
+ test
+
diff --git a/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/config/AdminServerDiscoveryAutoConfigurationTest.java b/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/config/AdminServerDiscoveryAutoConfigurationTest.java
index 34ab4fb8001..d199d6cf721 100644
--- a/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/config/AdminServerDiscoveryAutoConfigurationTest.java
+++ b/spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/config/AdminServerDiscoveryAutoConfigurationTest.java
@@ -20,10 +20,10 @@
import io.kubernetes.client.openapi.apis.CoreV1Api;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.autoconfigure.http.client.reactive.ClientHttpConnectorAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.http.client.autoconfigure.reactive.ClientHttpConnectorAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
+import org.springframework.boot.webclient.autoconfigure.WebClientAutoConfiguration;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClientAutoConfiguration;
diff --git a/spring-boot-admin-server-ui/pom.xml b/spring-boot-admin-server-ui/pom.xml
index c50be933cdf..ff8c7eb3a48 100644
--- a/spring-boot-admin-server-ui/pom.xml
+++ b/spring-boot-admin-server-ui/pom.xml
@@ -60,6 +60,10 @@
com.google.code.findbugs
jsr305
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
org.springframework.boot
@@ -71,6 +75,11 @@
spring-boot-starter-security
test
+
+ org.springframework.boot
+ spring-boot-starter-mail
+ test
+
diff --git a/spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfiguration.java b/spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfiguration.java
index 4bfd9009223..af54579dd8f 100644
--- a/spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfiguration.java
+++ b/spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfiguration.java
@@ -29,8 +29,8 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.webflux.autoconfigure.WebFluxProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
@@ -181,7 +181,7 @@ public AdminUiWebfluxConfig(AdminServerUiProperties adminUi, AdminServerProperti
@Bean
public HomepageForwardingFilterConfig homepageForwardingFilterConfig() throws IOException {
- String webFluxBasePath = webFluxProperties.getBasePath();
+ String webFluxBasePath = this.webFluxProperties.getBasePath();
boolean webfluxBasePathSet = webFluxBasePath != null;
String homepage = normalizeHomepageUrl(
webfluxBasePathSet ? webFluxBasePath + "/" : this.adminServer.path("/"));
@@ -248,7 +248,8 @@ public AdminUiWebMvcConfig(AdminServerUiProperties adminUi, AdminServerPropertie
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
- configurer.setUseTrailingSlashMatch(true);
+ // XXX: this method doesn't exists anymore in Spring 7
+ // configurer.setUseTrailingSlashMatch(true);
}
@Bean
diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfigurationTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfigurationTest.java
index b429abee839..4c87ba793a1 100644
--- a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfigurationTest.java
+++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfigurationTest.java
@@ -27,9 +27,9 @@
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
+import org.springframework.boot.webflux.autoconfigure.WebFluxProperties;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.mock.http.server.reactive.MockServerHttpRequest;
@@ -86,7 +86,7 @@ void contextPathIsRespectedInExcludedRoutes(String routeExcludes) {
AdminServerMarkerConfiguration.Marker.class)
.run((context) -> {
HomepageForwardingFilter bean = context.getBean(HomepageForwardingFilter.class);
- bean.filter(serverWebExchange, webFilterChain);
+ bean.filter(serverWebExchange, this.webFilterChain);
verify(serverWebExchange, never()).mutate();
});
@@ -107,7 +107,7 @@ void contextPathIsRespectedInIncludedRoutes(String routeIncludes) {
AdminServerMarkerConfiguration.Marker.class)
.run((context) -> {
HomepageForwardingFilter bean = context.getBean(HomepageForwardingFilter.class);
- bean.filter(serverWebExchange, webFilterChain);
+ bean.filter(serverWebExchange, this.webFilterChain);
verify(serverWebExchange, atMostOnce()).mutate();
});
diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ReactiveAdminServerUiAutoConfigurationAdminContextPathTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ReactiveAdminServerUiAutoConfigurationAdminContextPathTest.java
index 1b91ac533e8..870c565e34e 100644
--- a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ReactiveAdminServerUiAutoConfigurationAdminContextPathTest.java
+++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ReactiveAdminServerUiAutoConfigurationAdminContextPathTest.java
@@ -17,8 +17,8 @@
package de.codecentric.boot.admin.server.ui.config;
import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
+import org.springframework.boot.webflux.autoconfigure.WebFluxProperties;
import de.codecentric.boot.admin.server.config.AdminServerProperties;
diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ReactiveAdminServerUiAutoConfigurationBothPathsTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ReactiveAdminServerUiAutoConfigurationBothPathsTest.java
index 8554b3c66c0..7661aa6d09f 100644
--- a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ReactiveAdminServerUiAutoConfigurationBothPathsTest.java
+++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ReactiveAdminServerUiAutoConfigurationBothPathsTest.java
@@ -17,8 +17,8 @@
package de.codecentric.boot.admin.server.ui.config;
import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
+import org.springframework.boot.webflux.autoconfigure.WebFluxProperties;
import de.codecentric.boot.admin.server.config.AdminServerProperties;
diff --git a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ReactiveAdminServerUiAutoConfigurationWebfluxBasePathTest.java b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ReactiveAdminServerUiAutoConfigurationWebfluxBasePathTest.java
index 216579e04cd..494a3c10095 100644
--- a/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ReactiveAdminServerUiAutoConfigurationWebfluxBasePathTest.java
+++ b/spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/config/ReactiveAdminServerUiAutoConfigurationWebfluxBasePathTest.java
@@ -17,8 +17,8 @@
package de.codecentric.boot.admin.server.ui.config;
import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
+import org.springframework.boot.webflux.autoconfigure.WebFluxProperties;
import de.codecentric.boot.admin.server.config.AdminServerProperties;
diff --git a/spring-boot-admin-server/pom.xml b/spring-boot-admin-server/pom.xml
index 5b2a1771faa..b03227e1087 100644
--- a/spring-boot-admin-server/pom.xml
+++ b/spring-boot-admin-server/pom.xml
@@ -40,6 +40,14 @@
org.springframework.boot
spring-boot-starter-webflux
+
+ org.springframework.boot
+ spring-boot-restclient
+
+
+ org.springframework.boot
+ spring-boot-webclient
+
org.springframework.boot
spring-boot-starter-web
@@ -61,6 +69,15 @@
io.projectreactor.addons
reactor-extra
+
+ com.google.code.findbugs
+ jsr305
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
org.projectlombok
lombok
@@ -73,6 +90,11 @@
true
+
+ org.springframework.boot
+ spring-boot-hazelcast
+ true
+
com.hazelcast
hazelcast
@@ -147,5 +169,11 @@
junit-jupiter
test
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ test
+
diff --git a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerAutoConfiguration.java b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerAutoConfiguration.java
index e08229a6b86..1739db2fd7a 100644
--- a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerAutoConfiguration.java
+++ b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerAutoConfiguration.java
@@ -24,8 +24,8 @@
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.webclient.autoconfigure.WebClientAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
diff --git a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerHazelcastAutoConfiguration.java b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerHazelcastAutoConfiguration.java
index 497d0e772f5..fb8aedf0499 100644
--- a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerHazelcastAutoConfiguration.java
+++ b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerHazelcastAutoConfiguration.java
@@ -28,7 +28,7 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate;
-import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration;
+import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
diff --git a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfiguration.java b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfiguration.java
index 08b98ae603f..385039c71dc 100644
--- a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfiguration.java
+++ b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfiguration.java
@@ -33,9 +33,9 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate;
import org.springframework.boot.autoconfigure.condition.NoneNestedConditions;
-import org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.mail.autoconfigure.MailSenderAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
diff --git a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerWebConfiguration.java b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerWebConfiguration.java
index 3a8918647f9..ddbc507ff8f 100644
--- a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerWebConfiguration.java
+++ b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/config/AdminServerWebConfiguration.java
@@ -20,7 +20,7 @@
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
-import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
+import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java
index 7b47539de7e..802fc84538a 100644
--- a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java
+++ b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/DingTalkNotifier.java
@@ -21,9 +21,6 @@
import java.util.HashMap;
import java.util.Map;
-import javax.crypto.Mac;
-import javax.crypto.spec.SecretKeySpec;
-
import lombok.extern.slf4j.Slf4j;
import org.apache.hc.client5.http.utils.Base64;
import org.springframework.context.expression.MapAccessor;
@@ -73,18 +70,18 @@ public class DingTalkNotifier extends AbstractStatusChangeNotifier {
public DingTalkNotifier(InstanceRepository repository, RestTemplate restTemplate) {
super(repository);
this.restTemplate = restTemplate;
- this.message = parser.parseExpression(DEFAULT_MESSAGE, ParserContext.TEMPLATE_EXPRESSION);
+ this.message = this.parser.parseExpression(DEFAULT_MESSAGE, ParserContext.TEMPLATE_EXPRESSION);
}
@Override
protected Mono doNotify(InstanceEvent event, Instance instance) {
- return Mono
- .fromRunnable(() -> restTemplate.postForEntity(buildUrl(), createMessage(event, instance), Void.class));
+ return Mono.fromRunnable(
+ () -> this.restTemplate.postForEntity(buildUrl(), createMessage(event, instance), Void.class));
}
private String buildUrl() {
Long timestamp = System.currentTimeMillis();
- return String.format("%s×tamp=%s&sign=%s", webhookUrl, timestamp, getSign(timestamp));
+ return String.format("%s×tamp=%s&sign=%s", this.webhookUrl, timestamp, getSign(timestamp));
}
protected Object createMessage(InstanceEvent event, Instance instance) {
@@ -109,14 +106,14 @@ private Object getText(InstanceEvent event, Instance instance) {
.forPropertyAccessors(DataBindingPropertyAccessor.forReadOnlyAccess(), new MapAccessor())
.withRootObject(root)
.build();
- return message.getValue(context, String.class);
+ return this.message.getValue(context, String.class);
}
private String getSign(Long timestamp) {
try {
- String stringToSign = timestamp + "\n" + secret;
- Mac mac = Mac.getInstance("HmacSHA256");
- mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
+ String stringToSign = timestamp + "\n" + this.secret;
+ javax.crypto.Mac mac = javax.crypto.Mac.getInstance("HmacSHA256");
+ mac.init(new javax.crypto.spec.SecretKeySpec(this.secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
byte[] signData = mac.doFinal(stringToSign.getBytes(StandardCharsets.UTF_8));
return URLEncoder.encode(new String(Base64.encodeBase64(signData)), StandardCharsets.UTF_8);
}
@@ -131,7 +128,7 @@ public void setRestTemplate(RestTemplate restTemplate) {
}
public String getWebhookUrl() {
- return webhookUrl;
+ return this.webhookUrl;
}
public void setWebhookUrl(String webhookUrl) {
@@ -140,7 +137,7 @@ public void setWebhookUrl(String webhookUrl) {
@Nullable
public String getSecret() {
- return secret;
+ return this.secret;
}
public void setSecret(@Nullable String secret) {
@@ -148,11 +145,11 @@ public void setSecret(@Nullable String secret) {
}
public String getMessage() {
- return message.getExpressionString();
+ return this.message.getExpressionString();
}
public void setMessage(String message) {
- this.message = parser.parseExpression(message, ParserContext.TEMPLATE_EXPRESSION);
+ this.message = this.parser.parseExpression(message, ParserContext.TEMPLATE_EXPRESSION);
}
}
diff --git a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/FeiShuNotifier.java b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/FeiShuNotifier.java
index 0cfde33d633..46482f30709 100644
--- a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/FeiShuNotifier.java
+++ b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/notify/FeiShuNotifier.java
@@ -26,9 +26,6 @@
import java.util.Map;
import java.util.UUID;
-import javax.crypto.Mac;
-import javax.crypto.spec.SecretKeySpec;
-
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.expression.MapAccessor;
@@ -55,12 +52,11 @@
* @author sweeter
* @see https://open.feishu.cn/document/ukTMukTMukTM/ucTM5YjL3ETO24yNxkjN
- *
*/
@Slf4j
public class FeiShuNotifier extends AbstractStatusChangeNotifier {
- private static final String DEFAULT_MESSAGE = "ServiceName: #{instance.registration.name}(#{instance.id}) \nServiceUrl: #{instance.registration.serviceUrl} \nStatus: changed status from [#{lastStatus}] to [#{event.statusInfo.status}]";
+ private static String DEFAULT_MESSAGE = "ServiceName: #{instance.registration.name}(#{instance.id}) \nServiceUrl: #{instance.registration.serviceUrl} \nStatus: changed status from [#{lastStatus}] to [#{event.statusInfo.status}]";
private final SpelExpressionParser parser = new SpelExpressionParser();
@@ -75,7 +71,7 @@ public class FeiShuNotifier extends AbstractStatusChangeNotifier {
private URI webhookUrl;
/**
- * @ all.
+ *
*/
private boolean atAll = true;
@@ -102,7 +98,7 @@ public FeiShuNotifier(InstanceRepository repository, RestTemplate restTemplate)
@Override
protected Mono doNotify(InstanceEvent event, Instance instance) {
- if (webhookUrl == null) {
+ if (this.webhookUrl == null) {
return Mono.error(new IllegalStateException("'webhookUrl' must not be null."));
}
return Mono.fromRunnable(() -> {
@@ -116,8 +112,8 @@ protected Mono doNotify(InstanceEvent event, Instance instance) {
private String generateSign(String secret, long timestamp) {
try {
String stringToSign = timestamp + "\n" + secret;
- Mac mac = Mac.getInstance("HmacSHA256");
- mac.init(new SecretKeySpec(stringToSign.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
+ javax.crypto.Mac mac = javax.crypto.Mac.getInstance("HmacSHA256");
+ mac.init(new javax.crypto.spec.SecretKeySpec(stringToSign.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
byte[] signData = mac.doFinal(new byte[] {});
return new String(Base64.getEncoder().encode(signData));
}
@@ -237,7 +233,7 @@ public void setRestTemplate(RestTemplate restTemplate) {
}
public boolean isAtAll() {
- return atAll;
+ return this.atAll;
}
public void setAtAll(boolean atAll) {
@@ -245,7 +241,7 @@ public void setAtAll(boolean atAll) {
}
public String getSecret() {
- return secret;
+ return this.secret;
}
public void setSecret(String secret) {
@@ -253,7 +249,7 @@ public void setSecret(String secret) {
}
public MessageType getMessageType() {
- return messageType;
+ return this.messageType;
}
public void setMessageType(MessageType messageType) {
@@ -261,7 +257,7 @@ public void setMessageType(MessageType messageType) {
}
public Card getCard() {
- return card;
+ return this.card;
}
public void setCard(Card card) {
@@ -284,7 +280,7 @@ public static class Card {
private String themeColor = "red";
public String getTitle() {
- return title;
+ return this.title;
}
public void setTitle(String title) {
@@ -292,7 +288,7 @@ public void setTitle(String title) {
}
public String getThemeColor() {
- return themeColor;
+ return this.themeColor;
}
public void setThemeColor(String themeColor) {
diff --git a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/HttpHeaderFilter.java b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/HttpHeaderFilter.java
index 77716ea827b..2003a65100b 100644
--- a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/HttpHeaderFilter.java
+++ b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/HttpHeaderFilter.java
@@ -48,7 +48,7 @@ public HttpHeaderFilter(Set ignoredHeaders) {
public HttpHeaders filterHeaders(HttpHeaders headers) {
HttpHeaders filtered = new HttpHeaders();
- filtered.putAll(headers.entrySet()
+ filtered.putAll(headers.headerSet()
.stream()
.filter((e) -> this.includeHeader(e.getKey()))
.collect(toMap(Map.Entry::getKey, Map.Entry::getValue)));
diff --git a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunctions.java b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunctions.java
index f4c052c738d..b3a7550ecbc 100644
--- a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunctions.java
+++ b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/client/InstanceExchangeFilterFunctions.java
@@ -160,8 +160,7 @@ private static Boolean isLegacyResponse(ClientResponse response) {
private static ClientResponse convertLegacyResponse(LegacyEndpointConverter converter, ClientResponse response) {
return response.mutate().headers((headers) -> {
- headers.replace(HttpHeaders.CONTENT_TYPE,
- singletonList(ApiVersion.LATEST.getProducedMimeType().toString()));
+ headers.setContentType(MediaType.asMediaType(ApiVersion.LATEST.getProducedMimeType()));
headers.remove(HttpHeaders.CONTENT_LENGTH);
}).body(converter::convert).build();
}
@@ -235,7 +234,8 @@ public static InstanceExchangeFilterFunction handleCookies(final PerInstanceCook
private static ClientRequest enrichRequestWithStoredCookies(final InstanceId instId, final ClientRequest request,
final PerInstanceCookieStore store) {
- final MultiValueMap storedCookies = store.get(instId, request.url(), request.headers());
+ final MultiValueMap storedCookies = store.get(instId, request.url(),
+ request.headers().asMultiValueMap());
if (CollectionUtils.isEmpty(storedCookies)) {
log.trace("No cookies found for request [url={}]", request.url());
return request;
@@ -251,7 +251,7 @@ private static ClientResponse storeCookiesFromResponse(final InstanceId instId,
log.trace("Searching for cookies in header values of response [url={},headerValues={}]", request.url(),
headers);
- store.put(instId, request.url(), headers);
+ store.put(instId, request.url(), headers.asMultiValueMap());
return response;
}
diff --git a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/reactive/AdminControllerHandlerMapping.java b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/reactive/AdminControllerHandlerMapping.java
index ebfa8153d9b..df0a3df53ec 100644
--- a/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/reactive/AdminControllerHandlerMapping.java
+++ b/spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/web/reactive/AdminControllerHandlerMapping.java
@@ -22,6 +22,7 @@
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.reactive.result.condition.PatternsRequestCondition;
import org.springframework.web.reactive.result.method.RequestMappingInfo;
import org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping;
@@ -54,9 +55,13 @@ private RequestMappingInfo withPrefix(RequestMappingInfo mapping) {
}
PatternsRequestCondition patternsCondition = new PatternsRequestCondition(
withNewPatterns(mapping.getPatternsCondition().getPatterns()));
- return new RequestMappingInfo(patternsCondition, mapping.getMethodsCondition(), mapping.getParamsCondition(),
- mapping.getHeadersCondition(), mapping.getConsumesCondition(), mapping.getProducesCondition(),
- mapping.getCustomCondition());
+ return RequestMappingInfo.paths(patternsCondition.getPatterns().toArray(new String[0]))
+ .methods(mapping.getMethodsCondition().getMethods().toArray(new RequestMethod[0]))
+ .params(mapping.getParamsCondition().getExpressions().toArray(new String[0]))
+ .headers(mapping.getHeadersCondition().getExpressions().toArray(new String[0]))
+ .consumes(mapping.getConsumesCondition().getExpressions().toArray(new String[0]))
+ .produces(mapping.getProducesCondition().getExpressions().toArray(new String[0]))
+ .build();
}
private List withNewPatterns(Set patterns) {
diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerAutoConfigurationTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerAutoConfigurationTest.java
index f875cd615c2..25bef8e4649 100644
--- a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerAutoConfigurationTest.java
+++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerAutoConfigurationTest.java
@@ -19,12 +19,12 @@
import com.hazelcast.config.Config;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration;
-import org.springframework.boot.autoconfigure.http.client.reactive.ClientHttpConnectorAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
+import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration;
+import org.springframework.boot.http.client.autoconfigure.reactive.ClientHttpConnectorAutoConfiguration;
+import org.springframework.boot.restclient.autoconfigure.RestTemplateAutoConfiguration;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
+import org.springframework.boot.webclient.autoconfigure.WebClientAutoConfiguration;
+import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
import org.springframework.context.annotation.Bean;
import reactor.core.publisher.Mono;
diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerCloudFoundryAutoConfigurationTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerCloudFoundryAutoConfigurationTest.java
index d10445529d7..5dec9150198 100644
--- a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerCloudFoundryAutoConfigurationTest.java
+++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerCloudFoundryAutoConfigurationTest.java
@@ -18,12 +18,12 @@
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration;
-import org.springframework.boot.autoconfigure.http.client.reactive.ClientHttpConnectorAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
+import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration;
+import org.springframework.boot.http.client.autoconfigure.reactive.ClientHttpConnectorAutoConfiguration;
+import org.springframework.boot.restclient.autoconfigure.RestTemplateAutoConfiguration;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
+import org.springframework.boot.webclient.autoconfigure.WebClientAutoConfiguration;
+import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
import de.codecentric.boot.admin.server.services.CloudFoundryInstanceIdGenerator;
import de.codecentric.boot.admin.server.services.HashingInstanceUrlIdGenerator;
diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerInstanceWebClientConfigurationTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerInstanceWebClientConfigurationTest.java
index ec43ae73834..f2c15b359c8 100644
--- a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerInstanceWebClientConfigurationTest.java
+++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerInstanceWebClientConfigurationTest.java
@@ -18,11 +18,11 @@
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.autoconfigure.http.client.reactive.ClientHttpConnectorAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
+import org.springframework.boot.http.client.autoconfigure.reactive.ClientHttpConnectorAutoConfiguration;
+import org.springframework.boot.restclient.autoconfigure.RestTemplateAutoConfiguration;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
+import org.springframework.boot.webclient.autoconfigure.WebClientAutoConfiguration;
+import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
import de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider;
import de.codecentric.boot.admin.server.web.client.InstanceExchangeFilterFunction;
diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfigurationTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfigurationTest.java
index 1ba037a2572..18859f4f2e2 100644
--- a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfigurationTest.java
+++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerNotifierAutoConfigurationTest.java
@@ -19,12 +19,12 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration;
-import org.springframework.boot.autoconfigure.http.client.reactive.ClientHttpConnectorAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration;
-import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
+import org.springframework.boot.hazelcast.autoconfigure.HazelcastAutoConfiguration;
+import org.springframework.boot.http.client.autoconfigure.reactive.ClientHttpConnectorAutoConfiguration;
+import org.springframework.boot.restclient.autoconfigure.RestTemplateAutoConfiguration;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
+import org.springframework.boot.webclient.autoconfigure.WebClientAutoConfiguration;
+import org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.mail.javamail.JavaMailSenderImpl;
diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/FeiShuNotifierTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/FeiShuNotifierTest.java
index d76bbd91713..4a858a30a34 100644
--- a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/FeiShuNotifierTest.java
+++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/FeiShuNotifierTest.java
@@ -81,8 +81,8 @@ void test_onApplicationEvent_resolve() {
.notify(new InstanceStatusChangedEvent(instance.getId(), instance.getVersion(), StatusInfo.ofUp())))
.verifyComplete();
- assertThat(httpRequest.getValue().getHeaders()).containsEntry("Content-Type",
- Collections.singletonList("application/json"));
+ assertThat(httpRequest.getValue().getHeaders().get("Content-Type"))
+ .containsAll(Collections.singletonList("application/json"));
Map body = httpRequest.getValue().getBody();
assertThat(body).containsEntry("card",
@@ -109,8 +109,8 @@ void test_onApplicationEvent_trigger() {
.create(notifier.notify(new InstanceStatusChangedEvent(instance.getId(), instance.getVersion(), infoDown)))
.verifyComplete();
- assertThat(httpRequest.getValue().getHeaders()).containsEntry("Content-Type",
- Collections.singletonList("application/json"));
+ assertThat(httpRequest.getValue().getHeaders().get("Content-Type"))
+ .containsAll(Collections.singletonList("application/json"));
Map body = httpRequest.getValue().getBody();
assertThat(body).containsEntry("card",
"{\"elements\":[{\"tag\":\"div\",\"text\":{\"tag\":\"plain_text\",\"content\":\"ServiceName: App(-id-) \\nServiceUrl: \\nStatus: changed status from [UP] to [DOWN]\"}},{\"tag\":\"div\",\"text\":{\"tag\":\"lark_md\",\"content\":\"\"}}],\"header\":{\"template\":\"red\",\"title\":{\"tag\":\"plain_text\",\"content\":\"Codecentric's Spring Boot Admin notice\"}}}");
diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/HipchatNotifierTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/HipchatNotifierTest.java
index cdaddf6b276..1e3035037fb 100644
--- a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/HipchatNotifierTest.java
+++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/notify/HipchatNotifierTest.java
@@ -85,8 +85,8 @@ void test_onApplicationEvent_resolve() {
.notify(new InstanceStatusChangedEvent(instance.getId(), instance.getVersion(), StatusInfo.ofUp())))
.verifyComplete();
- assertThat(httpRequest.getValue().getHeaders()).containsEntry("Content-Type",
- Collections.singletonList("application/json"));
+ assertThat(httpRequest.getValue().getHeaders().get("Content-Type"))
+ .containsAll(Collections.singletonList("application/json"));
Map body = httpRequest.getValue().getBody();
assertThat(body).containsEntry("color", "green");
@@ -115,8 +115,8 @@ void test_onApplicationEvent_trigger() {
.create(notifier.notify(new InstanceStatusChangedEvent(instance.getId(), instance.getVersion(), infoDown)))
.verifyComplete();
- assertThat(httpRequest.getValue().getHeaders()).containsEntry("Content-Type",
- Collections.singletonList("application/json"));
+ assertThat(httpRequest.getValue().getHeaders().get("Content-Type"))
+ .containsAll(Collections.singletonList("application/json"));
Map body = httpRequest.getValue().getBody();
assertThat(body).containsEntry("color", "red");
assertThat(body).containsEntry("message", "App/-id- is DOWN");
diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/QueryIndexEndpointStrategyTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/QueryIndexEndpointStrategyTest.java
index b76622a6bde..dbda52fb780 100644
--- a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/QueryIndexEndpointStrategyTest.java
+++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/services/endpoints/QueryIndexEndpointStrategyTest.java
@@ -18,8 +18,6 @@
import java.time.Duration;
-import javax.net.ssl.SSLException;
-
import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.http.Fault;
import io.netty.handler.ssl.SslContextBuilder;
@@ -72,12 +70,12 @@ class QueryIndexEndpointStrategyTest {
@BeforeEach
void setUp() {
- wireMock.start();
+ this.wireMock.start();
}
@AfterEach
void tearDown() {
- wireMock.stop();
+ this.wireMock.stop();
}
@Test
@@ -268,7 +266,7 @@ private ReactorClientHttpConnector httpConnector() {
.trustManager(InsecureTrustManagerFactory.INSTANCE);
ssl.sslContext(sslCtx.build());
}
- catch (SSLException ex) {
+ catch (javax.net.ssl.SSLException ex) {
throw new RuntimeException(ex);
}
});
diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/BasicAuthHttpHeaderProviderTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/BasicAuthHttpHeaderProviderTest.java
index e97314d7c2b..b3d87c5611d 100644
--- a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/BasicAuthHttpHeaderProviderTest.java
+++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/BasicAuthHttpHeaderProviderTest.java
@@ -72,7 +72,7 @@ void test_auth_header_no_separator() {
void test_no_header() {
Registration registration = Registration.create("foo", "https://health").build();
Instance instance = Instance.create(InstanceId.of("id")).register(registration);
- assertThat(this.headersProvider.getHeaders(instance)).isEmpty();
+ assertThat(this.headersProvider.getHeaders(instance).asSingleValueMap()).isEmpty();
}
@Test
diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/CloudFoundryHttpHeaderProviderTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/CloudFoundryHttpHeaderProviderTest.java
index 8c3c80076d2..324a772bc31 100644
--- a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/CloudFoundryHttpHeaderProviderTest.java
+++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/CloudFoundryHttpHeaderProviderTest.java
@@ -35,7 +35,7 @@ void test_cloud_foundry_header() {
.metadata("instanceId", "0")
.build();
Instance instance = Instance.create(InstanceId.of("id")).register(registration);
- assertThat(headersProvider.getHeaders(instance).get("X-CF-APP-INSTANCE"))
+ assertThat(this.headersProvider.getHeaders(instance).get("X-CF-APP-INSTANCE"))
.containsOnly("549e64cf-a478-423d-9d6d-02d803a028a8:0");
}
@@ -43,7 +43,7 @@ void test_cloud_foundry_header() {
void test_no_header() {
Registration registration = Registration.create("foo", "https://health").build();
Instance instance = Instance.create(InstanceId.of("id")).register(registration);
- assertThat(headersProvider.getHeaders(instance)).isEmpty();
+ assertThat(this.headersProvider.getHeaders(instance).asSingleValueMap()).isEmpty();
}
}
diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/CompositeHttpHeadersProviderTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/CompositeHttpHeadersProviderTest.java
index d7e92d6b31e..6e285e24b08 100644
--- a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/CompositeHttpHeadersProviderTest.java
+++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/CompositeHttpHeadersProviderTest.java
@@ -41,16 +41,16 @@ void should_return_all_headers() {
}));
HttpHeaders headers = provider.getHeaders(null);
- assertThat(headers).containsEntry("a", singletonList("1"))
- .containsEntry("b", asList("2-a", "2-b"))
- .containsEntry("c", singletonList("3"));
+ assertThat(headers.get("a")).containsAll(singletonList("1"));
+ assertThat(headers.get("b")).containsAll(asList("2-a", "2-b"));
+ assertThat(headers.get("c")).containsAll(singletonList("3"));
}
@Test
void should_return_empty_headers() {
HttpHeadersProvider provider = new CompositeHttpHeadersProvider(emptyList());
HttpHeaders headers = provider.getHeaders(null);
- assertThat(headers).isEmpty();
+ assertThat(headers.asSingleValueMap()).isEmpty();
}
}
diff --git a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/reactive/CompositeReactiveHttpHeadersProviderTest.java b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/reactive/CompositeReactiveHttpHeadersProviderTest.java
index 9e94b07e0db..6204270fb72 100644
--- a/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/reactive/CompositeReactiveHttpHeadersProviderTest.java
+++ b/spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/web/client/reactive/CompositeReactiveHttpHeadersProviderTest.java
@@ -43,9 +43,9 @@ void should_return_all_headers() {
}));
StepVerifier.create(provider.getHeaders(null)).thenConsumeWhile((headers) -> {
- assertThat(headers).containsEntry("a", singletonList("1"))
- .containsEntry("b", asList("2-a", "2-b"))
- .containsEntry("c", singletonList("3"));
+ assertThat(headers.get("a")).containsAll(singletonList("1"));
+ assertThat(headers.get("b")).containsAll(asList("2-a", "2-b"));
+ assertThat(headers.get("c")).containsAll(singletonList("3"));
return true;
}).verifyComplete();
}
@@ -55,7 +55,7 @@ void should_return_empty_headers() {
CompositeReactiveHttpHeadersProvider provider = new CompositeReactiveHttpHeadersProvider(emptyList());
StepVerifier.create(provider.getHeaders(null)).thenConsumeWhile((headers) -> {
- assertThat(headers).isEmpty();
+ assertThat(headers.asSingleValueMap()).isEmpty();
return true;
}).verifyComplete();
}