Create spring-boot-health module

This commit is contained in:
Phillip Webb
2025-06-12 09:57:33 -07:00
parent dec8093e75
commit 2ddca76076
212 changed files with 753 additions and 632 deletions

View File

@@ -79,6 +79,7 @@ include "spring-boot-project:spring-boot-gson"
include "spring-boot-project:spring-boot-h2console"
include "spring-boot-project:spring-boot-hateoas"
include "spring-boot-project:spring-boot-hazelcast"
include "spring-boot-project:spring-boot-health"
include "spring-boot-project:spring-boot-hibernate"
include "spring-boot-project:spring-boot-http-client"
include "spring-boot-project:spring-boot-http-converter"

View File

@@ -16,6 +16,9 @@
package org.springframework.boot.actuate.autoconfigure.endpoint.jackson;
import java.util.HashSet;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
@@ -25,6 +28,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.health.HealthComponent;
import org.springframework.context.annotation.Bean;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
@@ -47,7 +51,22 @@ public class JacksonEndpointAutoConfiguration {
SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS)
.serializationInclusion(Include.NON_NULL)
.build();
return () -> objectMapper;
Set<Class<?>> supportedTypes = new HashSet<>(EndpointObjectMapper.DEFAULT_SUPPORTED_TYPES);
supportedTypes.add(HealthComponent.class);
return new EndpointObjectMapper() {
@Override
public ObjectMapper get() {
return objectMapper;
}
@Override
public Set<Class<?>> getSupportedTypes() {
return supportedTypes;
}
};
}
}

View File

@@ -20,8 +20,8 @@ import java.util.Collection;
import java.util.Map;
import org.springframework.boot.actuate.health.DefaultHealthContributorRegistry;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.health.HealthContributorRegistry;
import org.springframework.boot.health.HealthContributor;
import org.springframework.util.Assert;
/**

View File

@@ -21,7 +21,7 @@ import java.util.Map;
import org.springframework.boot.actuate.health.DefaultReactiveHealthContributorRegistry;
import org.springframework.boot.actuate.health.HealthContributorRegistry;
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.health.ReactiveHealthContributor;
import org.springframework.util.Assert;
/**

View File

@@ -19,9 +19,9 @@ package org.springframework.boot.actuate.autoconfigure.health;
import java.util.Map;
import java.util.function.Function;
import org.springframework.boot.actuate.health.CompositeHealthContributor;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.health.CompositeHealthContributor;
import org.springframework.boot.health.HealthContributor;
import org.springframework.boot.health.HealthIndicator;
/**
* Base class for health contributor configurations that can combine source beans into a

View File

@@ -19,9 +19,9 @@ package org.springframework.boot.actuate.autoconfigure.health;
import java.util.Map;
import java.util.function.Function;
import org.springframework.boot.actuate.health.CompositeReactiveHealthContributor;
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.actuate.health.ReactiveHealthIndicator;
import org.springframework.boot.health.CompositeReactiveHealthContributor;
import org.springframework.boot.health.ReactiveHealthContributor;
import org.springframework.boot.health.ReactiveHealthIndicator;
/**
* Base class for health contributor configurations that can combine source beans into a

View File

@@ -16,10 +16,10 @@
package org.springframework.boot.actuate.autoconfigure.health;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.health.PingHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.health.HealthContributor;
import org.springframework.context.annotation.Bean;
/**

View File

@@ -26,25 +26,25 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.SmartInitializingSingleton;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.actuate.health.CompositeHealthContributor;
import org.springframework.boot.actuate.health.CompositeReactiveHealthContributor;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.health.HealthContributorRegistry;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.actuate.health.HealthEndpointGroupsPostProcessor;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.HttpCodeStatusMapper;
import org.springframework.boot.actuate.health.NamedContributor;
import org.springframework.boot.actuate.health.NamedContributors;
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.actuate.health.ReactiveHealthIndicator;
import org.springframework.boot.actuate.health.SimpleHttpCodeStatusMapper;
import org.springframework.boot.actuate.health.SimpleStatusAggregator;
import org.springframework.boot.actuate.health.StatusAggregator;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.health.CompositeHealthContributor;
import org.springframework.boot.health.CompositeReactiveHealthContributor;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthContributor;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.NamedContributor;
import org.springframework.boot.health.NamedContributors;
import org.springframework.boot.health.ReactiveHealthContributor;
import org.springframework.boot.health.ReactiveHealthIndicator;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -21,14 +21,14 @@ import java.util.Map;
import reactor.core.publisher.Flux;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.actuate.health.ReactiveHealthContributorRegistry;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.health.HealthContributor;
import org.springframework.boot.health.ReactiveHealthContributor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -22,8 +22,8 @@ import java.util.Map;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.NamedContributor;
import org.springframework.boot.actuate.health.NamedContributors;
import org.springframework.boot.health.NamedContributor;
import org.springframework.boot.health.NamedContributors;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -21,8 +21,8 @@ import java.util.Collections;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.health.HealthContributorRegistry;
import org.springframework.boot.health.HealthIndicator;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
import static org.mockito.Mockito.mock;
@@ -38,7 +38,7 @@ class AutoConfiguredHealthContributorRegistryTests {
void createWhenContributorsClashesWithGroupNameThrowsException() {
assertThatIllegalStateException()
.isThrownBy(() -> new AutoConfiguredHealthContributorRegistry(
Collections.singletonMap("boot", mock(HealthContributor.class)), Arrays.asList("spring", "boot")))
Collections.singletonMap("boot", mock(HealthIndicator.class)), Arrays.asList("spring", "boot")))
.withMessage("HealthContributor with name \"boot\" clashes with group");
}
@@ -47,7 +47,7 @@ class AutoConfiguredHealthContributorRegistryTests {
HealthContributorRegistry registry = new AutoConfiguredHealthContributorRegistry(Collections.emptyMap(),
Arrays.asList("spring", "boot"));
assertThatIllegalStateException()
.isThrownBy(() -> registry.registerContributor("spring", mock(HealthContributor.class)))
.isThrownBy(() -> registry.registerContributor("spring", mock(HealthIndicator.class)))
.withMessage("HealthContributor with name \"spring\" clashes with group");
}

View File

@@ -31,10 +31,10 @@ import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.actuate.health.HttpCodeStatusMapper;
import org.springframework.boot.actuate.health.SimpleHttpCodeStatusMapper;
import org.springframework.boot.actuate.health.SimpleStatusAggregator;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.actuate.health.StatusAggregator;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.health.Status;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;

View File

@@ -21,8 +21,8 @@ import java.util.Collections;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.actuate.health.ReactiveHealthContributorRegistry;
import org.springframework.boot.health.ReactiveHealthIndicator;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
import static org.mockito.Mockito.mock;
@@ -38,7 +38,7 @@ class AutoConfiguredReactiveHealthContributorRegistryTests {
void createWhenContributorsClashesWithGroupNameThrowsException() {
assertThatIllegalStateException()
.isThrownBy(() -> new AutoConfiguredReactiveHealthContributorRegistry(
Collections.singletonMap("boot", mock(ReactiveHealthContributor.class)),
Collections.singletonMap("boot", mock(ReactiveHealthIndicator.class)),
Arrays.asList("spring", "boot")))
.withMessage("ReactiveHealthContributor with name \"boot\" clashes with group");
}
@@ -48,7 +48,7 @@ class AutoConfiguredReactiveHealthContributorRegistryTests {
ReactiveHealthContributorRegistry registry = new AutoConfiguredReactiveHealthContributorRegistry(
Collections.emptyMap(), Arrays.asList("spring", "boot"));
assertThatIllegalStateException()
.isThrownBy(() -> registry.registerContributor("spring", mock(ReactiveHealthContributor.class)))
.isThrownBy(() -> registry.registerContributor("spring", mock(ReactiveHealthIndicator.class)))
.withMessage("ReactiveHealthContributor with name \"spring\" clashes with group");
}

View File

@@ -17,9 +17,9 @@
package org.springframework.boot.actuate.autoconfigure.health;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfigurationTests.TestHealthIndicator;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health.Builder;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.health.AbstractHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthContributor;
/**
* Tests for {@link CompositeHealthContributorConfiguration}.
@@ -49,7 +49,7 @@ class CompositeHealthContributorConfigurationTests
}
@Override
protected void doHealthCheck(Builder builder) throws Exception {
protected void doHealthCheck(Health.Builder builder) throws Exception {
builder.up();
}

View File

@@ -19,10 +19,9 @@ package org.springframework.boot.actuate.autoconfigure.health;
import reactor.core.publisher.Mono;
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfigurationTests.TestReactiveHealthIndicator;
import org.springframework.boot.actuate.health.AbstractReactiveHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Health.Builder;
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.health.AbstractReactiveHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.ReactiveHealthContributor;
/**
* Tests for {@link CompositeReactiveHealthContributorConfiguration}.
@@ -52,7 +51,7 @@ class CompositeReactiveHealthContributorConfigurationTests extends
}
@Override
protected Mono<Health> doHealthCheck(Builder builder) {
protected Mono<Health> doHealthCheck(Health.Builder builder) {
return Mono.just(builder.up().build());
}

View File

@@ -18,10 +18,10 @@ package org.springframework.boot.actuate.autoconfigure.health;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.PingHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -30,26 +30,26 @@ import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
import org.springframework.boot.actuate.health.CompositeHealthContributor;
import org.springframework.boot.actuate.health.DefaultHealthContributorRegistry;
import org.springframework.boot.actuate.health.DefaultReactiveHealthContributorRegistry;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthComponent;
import org.springframework.boot.actuate.health.HealthContributorRegistry;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.actuate.health.HealthEndpointGroupsPostProcessor;
import org.springframework.boot.actuate.health.HealthEndpointWebExtension;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.HttpCodeStatusMapper;
import org.springframework.boot.actuate.health.NamedContributor;
import org.springframework.boot.actuate.health.ReactiveHealthContributorRegistry;
import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension;
import org.springframework.boot.actuate.health.ReactiveHealthIndicator;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.actuate.health.StatusAggregator;
import org.springframework.boot.actuate.health.SystemHealth;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.health.CompositeHealth;
import org.springframework.boot.health.CompositeHealthContributor;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.NamedContributor;
import org.springframework.boot.health.ReactiveHealthIndicator;
import org.springframework.boot.health.Status;
import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
@@ -317,7 +317,7 @@ class HealthEndpointAutoConfigurationTests {
.withParent(parent)
.run((context) -> {
HealthComponent health = context.getBean(HealthEndpoint.class).health();
Map<String, HealthComponent> components = ((SystemHealth) health).getComponents();
Map<String, HealthComponent> components = ((CompositeHealth) health).getComponents();
assertThat(components).containsKeys("additional", "ping", "simple");
}));
}
@@ -332,7 +332,7 @@ class HealthEndpointAutoConfigurationTests {
.withParent(parent)
.run((context) -> {
HealthComponent health = context.getBean(HealthEndpoint.class).health();
Map<String, HealthComponent> components = ((SystemHealth) health).getComponents();
Map<String, HealthComponent> components = ((CompositeHealth) health).getComponents();
assertThat(components).containsKeys("additional", "ping", "simple");
}));
}

View File

@@ -22,12 +22,12 @@ import java.util.List;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.ssl.SslHealthContributorAutoConfigurationTests.CustomSslInfoConfiguration.CustomSslHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.actuate.ssl.SslHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.ssl.SslAutoConfiguration;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.Status;
import org.springframework.boot.info.SslInfo;
import org.springframework.boot.info.SslInfo.CertificateChainInfo;
import org.springframework.boot.ssl.SslBundles;

View File

@@ -29,23 +29,23 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.docs.MockMvcEndpointDocumentationTests;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.health.AdditionalHealthEndpointPath;
import org.springframework.boot.actuate.health.CompositeHealthContributor;
import org.springframework.boot.actuate.health.DefaultHealthContributorRegistry;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.health.HealthContributorRegistry;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroup;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.HttpCodeStatusMapper;
import org.springframework.boot.actuate.health.SimpleHttpCodeStatusMapper;
import org.springframework.boot.actuate.health.SimpleStatusAggregator;
import org.springframework.boot.actuate.health.StatusAggregator;
import org.springframework.boot.actuate.system.DiskSpaceHealthIndicator;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.jdbc.actuate.health.DataSourceHealthIndicator;
import org.springframework.boot.health.CompositeHealthContributor;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthContributor;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration;
import org.springframework.boot.jdbc.health.DataSourceHealthIndicator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;

View File

@@ -27,6 +27,13 @@ import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.endpoint.web.test.WebEndpointTest;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.boot.health.CompositeHealthContributor;
import org.springframework.boot.health.CompositeReactiveHealthContributor;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthContributor;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.ReactiveHealthContributor;
import org.springframework.boot.health.ReactiveHealthIndicator;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -10,6 +10,7 @@ description = "Spring Boot Actuator"
dependencies {
api(project(":spring-boot-project:spring-boot"))
api(project(":spring-boot-project:spring-boot-health"))
optional(project(":spring-boot-project:spring-boot-http-converter"))
optional(project(":spring-boot-project:spring-boot-jsonb"))

View File

@@ -21,12 +21,12 @@ import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health.Builder;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.availability.ApplicationAvailability;
import org.springframework.boot.availability.AvailabilityState;
import org.springframework.boot.health.AbstractHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.Status;
import org.springframework.util.Assert;
/**
@@ -76,7 +76,7 @@ public class AvailabilityStateHealthIndicator extends AbstractHealthIndicator {
}
@Override
protected void doHealthCheck(Builder builder) throws Exception {
protected void doHealthCheck(Health.Builder builder) throws Exception {
AvailabilityState state = getState(this.applicationAvailability);
Status status = this.statusMappings.get(state);
if (status == null) {

View File

@@ -16,11 +16,11 @@
package org.springframework.boot.actuate.availability;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.availability.ApplicationAvailability;
import org.springframework.boot.availability.AvailabilityState;
import org.springframework.boot.availability.LivenessState;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.Status;
/**
* A {@link HealthIndicator} that checks the {@link LivenessState} of the application.

View File

@@ -16,11 +16,11 @@
package org.springframework.boot.actuate.availability;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.availability.ApplicationAvailability;
import org.springframework.boot.availability.AvailabilityState;
import org.springframework.boot.availability.ReadinessState;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.Status;
/**
* A {@link HealthIndicator} that checks the {@link ReadinessState} of the application.

View File

@@ -16,6 +16,10 @@
package org.springframework.boot.actuate.health;
import org.springframework.boot.health.HealthContributor;
import org.springframework.boot.health.NamedContributors;
import org.springframework.boot.health.ReactiveHealthContributor;
/**
* A mutable registry of health endpoint contributors (either {@link HealthContributor} or
* {@link ReactiveHealthContributor}).

View File

@@ -23,6 +23,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.function.Function;
import org.springframework.boot.health.NamedContributor;
import org.springframework.util.Assert;
/**

View File

@@ -19,6 +19,8 @@ package org.springframework.boot.actuate.health;
import java.util.Map;
import java.util.function.Function;
import org.springframework.boot.health.HealthContributor;
/**
* Default {@link HealthContributorRegistry} implementation.
*

View File

@@ -19,6 +19,8 @@ package org.springframework.boot.actuate.health;
import java.util.Map;
import java.util.function.Function;
import org.springframework.boot.health.ReactiveHealthContributor;
/**
* Default {@link ReactiveHealthContributorRegistry} implementation.
*

View File

@@ -16,6 +16,8 @@
package org.springframework.boot.actuate.health;
import org.springframework.boot.health.HealthContributor;
/**
* {@link ContributorRegistry} for {@link HealthContributor HealthContributors}.
*

View File

@@ -27,6 +27,9 @@ import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.Selector;
import org.springframework.boot.actuate.endpoint.annotation.Selector.Match;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.HealthContributor;
import org.springframework.boot.health.HealthIndicator;
/**
* {@link Endpoint @Endpoint} to expose application health information.

View File

@@ -17,6 +17,9 @@
package org.springframework.boot.actuate.health;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.health.CompositeHealth;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthContributor;
/**
* A logical grouping of {@link HealthContributor health contributors} that can be exposed

View File

@@ -30,6 +30,12 @@ import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
import org.springframework.boot.convert.DurationStyle;
import org.springframework.boot.health.CompositeHealth;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.NamedContributor;
import org.springframework.boot.health.NamedContributors;
import org.springframework.boot.health.Status;
import org.springframework.core.log.LogMessage;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
@@ -195,10 +201,7 @@ abstract class HealthEndpointSupport<C, T> {
Status status = statusAggregator
.getAggregateStatus(components.values().stream().map(this::getStatus).collect(Collectors.toSet()));
Map<String, HealthComponent> instances = showComponents ? components : null;
if (groupNames != null) {
return new SystemHealth(apiVersion, status, instances, groupNames);
}
return new CompositeHealth(apiVersion, status, instances);
return new SystemHealth(status, instances, groupNames, apiVersion);
}
private Status getStatus(HealthComponent component) {

View File

@@ -29,6 +29,9 @@ import org.springframework.boot.actuate.endpoint.annotation.Selector.Match;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
import org.springframework.boot.actuate.endpoint.web.annotation.EndpointWebExtension;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.HealthContributor;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.context.annotation.ImportRuntimeHints;
/**

View File

@@ -19,6 +19,8 @@ package org.springframework.boot.actuate.health;
import org.springframework.aot.hint.BindingReflectionHintsRegistrar;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.boot.health.CompositeHealth;
import org.springframework.boot.health.Health;
/**
* {@link RuntimeHintsRegistrar} used by {@link HealthEndpointWebExtension} and

View File

@@ -16,6 +16,8 @@
package org.springframework.boot.actuate.health;
import org.springframework.boot.health.Status;
/**
* Strategy used to map a {@link Status health status} to an HTTP status code.
*

View File

@@ -16,6 +16,11 @@
package org.springframework.boot.actuate.health;
import org.springframework.boot.health.AbstractHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.Status;
/**
* Default implementation of {@link HealthIndicator} that returns {@link Status#UP}.
*

View File

@@ -16,6 +16,8 @@
package org.springframework.boot.actuate.health;
import org.springframework.boot.health.ReactiveHealthContributor;
/**
* {@link ContributorRegistry} for {@link ReactiveHealthContributor
* ReactiveHealthContributors}.

View File

@@ -32,6 +32,9 @@ import org.springframework.boot.actuate.endpoint.annotation.Selector.Match;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
import org.springframework.boot.actuate.endpoint.web.annotation.EndpointWebExtension;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.ReactiveHealthContributor;
import org.springframework.boot.health.ReactiveHealthIndicator;
import org.springframework.context.annotation.ImportRuntimeHints;
/**

View File

@@ -22,6 +22,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.health.Status;
import org.springframework.util.CollectionUtils;
/**

View File

@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Set;
import java.util.stream.Stream;
import org.springframework.boot.health.Status;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;

View File

@@ -20,6 +20,9 @@ import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.Set;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.Status;
/**
* Strategy used to aggregate {@link Status} instances.
* <p>

View File

@@ -22,23 +22,41 @@ import java.util.TreeSet;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.health.CompositeHealth;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.Status;
/**
* A {@link HealthComponent} that represents the overall system health and the available
* A {@link CompositeHealth} that represents the overall system health and the available
* groups.
*
* @author Phillip Webb
* @since 2.2.0
* @since 4.0.0
*/
public final class SystemHealth extends CompositeHealth {
private final ApiVersion apiVersion;
private final Set<String> groups;
SystemHealth(ApiVersion apiVersion, Status status, Map<String, HealthComponent> instances, Set<String> groups) {
super(apiVersion, status, instances);
SystemHealth(Status status, Map<String, HealthComponent> components, Set<String> groups, ApiVersion apiVersion) {
super(status, components);
this.groups = (groups != null) ? new TreeSet<>(groups) : null;
this.apiVersion = apiVersion;
}
@Override
public Map<String, HealthComponent> getComponents() {
return (this.apiVersion == ApiVersion.V3) ? super.getComponents() : null;
}
@JsonProperty
@JsonInclude(Include.NON_EMPTY)
public Map<String, HealthComponent> getDetails() {
return (this.apiVersion == ApiVersion.V2) ? super.getComponents() : null;
}
@JsonInclude(Include.NON_EMPTY)

View File

@@ -22,10 +22,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health.Builder;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.AbstractHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.Status;
import org.springframework.boot.info.SslInfo;
import org.springframework.boot.info.SslInfo.BundleInfo;
import org.springframework.boot.info.SslInfo.CertificateChainInfo;
@@ -54,7 +54,7 @@ public class SslHealthIndicator extends AbstractHealthIndicator {
}
@Override
protected void doHealthCheck(Builder builder) throws Exception {
protected void doHealthCheck(Health.Builder builder) throws Exception {
List<CertificateChainInfo> validCertificateChains = new ArrayList<>();
List<CertificateChainInfo> invalidCertificateChains = new ArrayList<>();
List<CertificateChainInfo> expiringCerificateChains = new ArrayList<>();

View File

@@ -21,10 +21,10 @@ import java.io.File;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.AbstractHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.Status;
import org.springframework.core.log.LogMessage;
import org.springframework.util.unit.DataSize;

View File

@@ -21,10 +21,10 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.availability.ApplicationAvailability;
import org.springframework.boot.availability.AvailabilityState;
import org.springframework.boot.availability.LivenessState;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -19,9 +19,9 @@ package org.springframework.boot.actuate.availability;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.availability.ApplicationAvailability;
import org.springframework.boot.availability.LivenessState;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;

View File

@@ -19,9 +19,9 @@ package org.springframework.boot.actuate.availability;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.availability.ApplicationAvailability;
import org.springframework.boot.availability.ReadinessState;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;

View File

@@ -1,97 +0,0 @@
/*
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.actuate.health;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.endpoint.ApiVersion;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
/**
* Test for {@link CompositeHealth}.
*
* @author Phillip Webb
*/
class CompositeHealthTests {
@Test
void createWhenStatusIsNullThrowsException() {
assertThatIllegalArgumentException()
.isThrownBy(() -> new CompositeHealth(ApiVersion.V3, null, Collections.emptyMap()))
.withMessage("'status' must not be null");
}
@Test
void getStatusReturnsStatus() {
CompositeHealth health = new CompositeHealth(ApiVersion.V3, Status.UP, Collections.emptyMap());
assertThat(health.getStatus()).isEqualTo(Status.UP);
}
@Test
void getComponentReturnsComponents() {
Map<String, HealthComponent> components = new LinkedHashMap<>();
components.put("a", Health.up().build());
CompositeHealth health = new CompositeHealth(ApiVersion.V3, Status.UP, components);
assertThat(health.getComponents()).isEqualTo(components);
}
@Test
void serializeV3WithJacksonReturnsValidJson() throws Exception {
Map<String, HealthComponent> components = new LinkedHashMap<>();
components.put("db1", Health.up().build());
components.put("db2", Health.down().withDetail("a", "b").build());
CompositeHealth health = new CompositeHealth(ApiVersion.V3, Status.UP, components);
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(health);
assertThat(json).isEqualTo("{\"status\":\"UP\",\"components\":{\"db1\":{\"status\":\"UP\"},"
+ "\"db2\":{\"status\":\"DOWN\",\"details\":{\"a\":\"b\"}}}}");
}
@Test
void serializeV2WithJacksonReturnsValidJson() throws Exception {
Map<String, HealthComponent> components = new LinkedHashMap<>();
components.put("db1", Health.up().build());
components.put("db2", Health.down().withDetail("a", "b").build());
CompositeHealth health = new CompositeHealth(ApiVersion.V2, Status.UP, components);
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(health);
assertThat(json).isEqualTo("{\"status\":\"UP\",\"details\":{\"db1\":{\"status\":\"UP\"},"
+ "\"db2\":{\"status\":\"DOWN\",\"details\":{\"a\":\"b\"}}}}");
}
@Test // gh-26797
void serializeV2WithJacksonAndDisabledCanOverrideAccessModifiersReturnsValidJson() throws Exception {
Map<String, HealthComponent> components = new LinkedHashMap<>();
components.put("db1", Health.up().build());
components.put("db2", Health.down().withDetail("a", "b").build());
CompositeHealth health = new CompositeHealth(ApiVersion.V2, Status.UP, components);
JsonMapper mapper = JsonMapper.builder().disable(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS).build();
String json = mapper.writeValueAsString(health);
assertThat(json).isEqualTo("{\"status\":\"UP\",\"details\":{\"db1\":{\"status\":\"UP\"},"
+ "\"db2\":{\"status\":\"DOWN\",\"details\":{\"a\":\"b\"}}}}");
}
}

View File

@@ -22,6 +22,10 @@ import java.util.Iterator;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.NamedContributor;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;

View File

@@ -28,6 +28,10 @@ import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
import org.springframework.boot.actuate.health.HealthEndpointSupport.HealthResult;
import org.springframework.boot.health.CompositeHealth;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
@@ -202,7 +206,8 @@ abstract class HealthEndpointSupportTests<S extends HealthEndpointSupport<C, T>,
this.registry.registerContributor("atest", createContributor(this.up));
HealthResult<T> result = create(this.registry, this.groups).getHealth(ApiVersion.V3, null, SecurityContext.NONE,
false, "alltheas");
assertThat(getHealth(result)).isNotInstanceOf(SystemHealth.class);
SystemHealth systemHealth = (SystemHealth) getHealth(result);
assertThat(systemHealth.getGroups()).isNull();
}
@Test

View File

@@ -24,6 +24,12 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.actuate.health.HealthEndpointSupport.HealthResult;
import org.springframework.boot.health.CompositeHealthContributor;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.HealthContributor;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.Status;
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;

View File

@@ -23,6 +23,8 @@ import org.junit.jupiter.api.Test;
import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
import org.springframework.boot.health.CompositeHealth;
import org.springframework.boot.health.Health;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -27,6 +27,12 @@ import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
import org.springframework.boot.actuate.health.HealthEndpointSupport.HealthResult;
import org.springframework.boot.health.CompositeHealthContributor;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.HealthContributor;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

View File

@@ -18,6 +18,8 @@ package org.springframework.boot.actuate.health;
import org.junit.jupiter.api.Test;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
/**

View File

@@ -27,6 +27,12 @@ import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.actuate.health.HealthEndpointSupport.HealthResult;
import org.springframework.boot.health.CompositeReactiveHealthContributor;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.ReactiveHealthContributor;
import org.springframework.boot.health.ReactiveHealthIndicator;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

View File

@@ -23,7 +23,8 @@ import org.junit.jupiter.api.extension.ExtendWith;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
import org.springframework.boot.actuate.health.Health.Builder;
import org.springframework.boot.health.AbstractReactiveHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;
@@ -73,7 +74,7 @@ class ReactiveHealthIndicatorImplementationTests {
}
@Override
protected Mono<Health> doHealthCheck(Builder builder) {
protected Mono<Health> doHealthCheck(Health.Builder builder) {
return Mono.just(builder.up().build());
}
@@ -86,7 +87,7 @@ class ReactiveHealthIndicatorImplementationTests {
}
@Override
protected Mono<Health> doHealthCheck(Builder builder) {
protected Mono<Health> doHealthCheck(Health.Builder builder) {
return Mono.error(new UnsupportedOperationException());
}
@@ -100,7 +101,7 @@ class ReactiveHealthIndicatorImplementationTests {
}
@Override
protected Mono<Health> doHealthCheck(Builder builder) {
protected Mono<Health> doHealthCheck(Health.Builder builder) {
throw new RuntimeException();
}

View File

@@ -22,6 +22,7 @@ import java.util.Map;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -18,6 +18,8 @@ package org.springframework.boot.actuate.health;
import org.junit.jupiter.api.Test;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
/**

View File

@@ -17,15 +17,22 @@
package org.springframework.boot.actuate.health;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.health.CompositeHealth;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
@@ -42,7 +49,7 @@ class SystemHealthTests {
components.put("db1", Health.up().build());
components.put("db2", Health.down().withDetail("a", "b").build());
Set<String> groups = new LinkedHashSet<>(Arrays.asList("liveness", "readiness"));
CompositeHealth health = new SystemHealth(ApiVersion.V3, Status.UP, components, groups);
CompositeHealth health = new SystemHealth(Status.UP, components, groups, ApiVersion.V3);
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(health);
assertThat(json).isEqualTo("{\"status\":\"UP\",\"components\":{\"db1\":{\"status\":\"UP\"},"
@@ -50,4 +57,28 @@ class SystemHealthTests {
+ "\"groups\":[\"liveness\",\"readiness\"]}");
}
@Test
void serializeWhenNoGroupsWithJacksonReturnsValidJson() throws Exception {
Map<String, HealthComponent> components = new LinkedHashMap<>();
components.put("db1", Health.up().build());
components.put("db2", Health.down().withDetail("a", "b").build());
CompositeHealth health = new SystemHealth(Status.UP, components, null, ApiVersion.V2);
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(health);
assertThat(json).isEqualTo("{\"status\":\"UP\",\"details\":{\"db1\":{\"status\":\"UP\"},"
+ "\"db2\":{\"status\":\"DOWN\",\"details\":{\"a\":\"b\"}}}}");
}
@Test // gh-26797
void serializeV2WithJacksonAndDisabledCanOverrideAccessModifiersReturnsValidJson() throws Exception {
Map<String, HealthComponent> components = new LinkedHashMap<>();
components.put("db1", Health.up().build());
components.put("db2", Health.down().withDetail("a", "b").build());
CompositeHealth health = new SystemHealth(Status.UP, components, Collections.emptySet(), ApiVersion.V2);
JsonMapper mapper = JsonMapper.builder().disable(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS).build();
String json = mapper.writeValueAsString(health);
assertThat(json).isEqualTo("{\"status\":\"UP\",\"details\":{\"db1\":{\"status\":\"UP\"},"
+ "\"db2\":{\"status\":\"DOWN\",\"details\":{\"a\":\"b\"}}}}");
}
}

View File

@@ -23,8 +23,8 @@ import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.Status;
import org.springframework.boot.info.SslInfo;
import org.springframework.boot.info.SslInfo.BundleInfo;
import org.springframework.boot.info.SslInfo.CertificateChainInfo;

View File

@@ -24,9 +24,9 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.Status;
import org.springframework.util.unit.DataSize;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -20,14 +20,14 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.amqp.actuate.health.RabbitHealthIndicator;
import org.springframework.boot.amqp.autoconfigure.RabbitAutoConfiguration;
import org.springframework.boot.amqp.health.RabbitHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.health.HealthContributor;
import org.springframework.context.annotation.Bean;
/**

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.boot.amqp.actuate.health;
package org.springframework.boot.amqp.health;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.health.AbstractHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.util.Assert;
/**

View File

@@ -17,4 +17,4 @@
/**
* Health integration for AMQP and RabbitMQ.
*/
package org.springframework.boot.amqp.actuate.health;
package org.springframework.boot.amqp.health;

View File

@@ -19,8 +19,8 @@ package org.springframework.boot.amqp.autoconfigure.health;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.amqp.actuate.health.RabbitHealthIndicator;
import org.springframework.boot.amqp.autoconfigure.RabbitAutoConfiguration;
import org.springframework.boot.amqp.health.RabbitHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.amqp.actuate.health;
package org.springframework.boot.amqp.health;
import java.util.Collections;
@@ -27,8 +27,8 @@ import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.amqp.rabbit.core.ChannelCallback;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -22,9 +22,9 @@ import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnable
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.cassandra.actuate.health.CassandraDriverHealthIndicator;
import org.springframework.boot.cassandra.autoconfigure.CassandraAutoConfiguration;
import org.springframework.boot.cassandra.autoconfigure.health.CassandraHealthContributorConfigurations.CassandraDriverConfiguration;
import org.springframework.boot.cassandra.health.CassandraDriverHealthIndicator;
import org.springframework.context.annotation.Import;
/**

View File

@@ -23,12 +23,12 @@ import com.datastax.oss.driver.api.core.CqlSession;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.cassandra.actuate.health.CassandraDriverHealthIndicator;
import org.springframework.boot.cassandra.actuate.health.CassandraDriverReactiveHealthIndicator;
import org.springframework.boot.cassandra.health.CassandraDriverHealthIndicator;
import org.springframework.boot.cassandra.health.CassandraDriverReactiveHealthIndicator;
import org.springframework.boot.health.HealthContributor;
import org.springframework.boot.health.ReactiveHealthContributor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

View File

@@ -23,9 +23,9 @@ import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnable
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.cassandra.actuate.health.CassandraDriverReactiveHealthIndicator;
import org.springframework.boot.cassandra.autoconfigure.CassandraAutoConfiguration;
import org.springframework.boot.cassandra.autoconfigure.health.CassandraHealthContributorConfigurations.CassandraReactiveDriverConfiguration;
import org.springframework.boot.cassandra.health.CassandraDriverReactiveHealthIndicator;
import org.springframework.context.annotation.Import;
/**

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.cassandra.actuate.health;
package org.springframework.boot.cassandra.health;
import java.util.Collection;
import java.util.Optional;
@@ -23,10 +23,10 @@ import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.metadata.Node;
import com.datastax.oss.driver.api.core.metadata.NodeState;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.AbstractHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.Status;
import org.springframework.util.Assert;
/**

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.cassandra.actuate.health;
package org.springframework.boot.cassandra.health;
import java.util.Collection;
import java.util.Optional;
@@ -24,10 +24,10 @@ import com.datastax.oss.driver.api.core.metadata.Node;
import com.datastax.oss.driver.api.core.metadata.NodeState;
import reactor.core.publisher.Mono;
import org.springframework.boot.actuate.health.AbstractReactiveHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.ReactiveHealthIndicator;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.AbstractReactiveHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.ReactiveHealthIndicator;
import org.springframework.boot.health.Status;
import org.springframework.util.Assert;
/**

View File

@@ -17,4 +17,4 @@
/**
* Health integration for Cassandra.
*/
package org.springframework.boot.cassandra.actuate.health;
package org.springframework.boot.cassandra.health;

View File

@@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.cassandra.actuate.health.CassandraDriverHealthIndicator;
import org.springframework.boot.cassandra.health.CassandraDriverHealthIndicator;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -21,7 +21,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.cassandra.actuate.health.CassandraDriverReactiveHealthIndicator;
import org.springframework.boot.cassandra.health.CassandraDriverReactiveHealthIndicator;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.cassandra.actuate.health;
package org.springframework.boot.cassandra.health;
import java.util.ArrayList;
import java.util.Collections;
@@ -31,8 +31,8 @@ import com.datastax.oss.driver.api.core.metadata.Node;
import com.datastax.oss.driver.api.core.metadata.NodeState;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.cassandra.actuate.health;
package org.springframework.boot.cassandra.health;
import java.time.Duration;
import java.util.ArrayList;
@@ -34,8 +34,8 @@ import org.junit.jupiter.api.Test;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;

View File

@@ -25,10 +25,10 @@ import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.Selector;
import org.springframework.boot.actuate.endpoint.annotation.Selector.Match;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.actuate.health.HealthComponent;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension;
import org.springframework.boot.cloudfoundry.actuate.autoconfigure.endpoint.EndpointCloudFoundryExtension;
import org.springframework.boot.health.HealthComponent;
/**
* Reactive {@link EndpointExtension @EndpointExtension} for the {@link HealthEndpoint}

View File

@@ -23,10 +23,10 @@ import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.Selector;
import org.springframework.boot.actuate.endpoint.annotation.Selector.Match;
import org.springframework.boot.actuate.endpoint.web.WebEndpointResponse;
import org.springframework.boot.actuate.health.HealthComponent;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointWebExtension;
import org.springframework.boot.cloudfoundry.actuate.autoconfigure.endpoint.EndpointCloudFoundryExtension;
import org.springframework.boot.health.HealthComponent;
/**
* {@link EndpointExtension @EndpointExtension} for the {@link HealthEndpoint} that always

View File

@@ -26,12 +26,12 @@ import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAu
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration;
import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.health.CompositeHealth;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthComponent;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.health.CompositeHealth;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.http.converter.autoconfigure.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
import org.springframework.boot.security.autoconfigure.reactive.ReactiveSecurityAutoConfiguration;

View File

@@ -24,12 +24,12 @@ import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAu
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration;
import org.springframework.boot.actuate.endpoint.ApiVersion;
import org.springframework.boot.actuate.health.CompositeHealth;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthComponent;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.health.CompositeHealth;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthComponent;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.http.converter.autoconfigure.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
import org.springframework.boot.restclient.autoconfigure.RestTemplateAutoConfiguration;

View File

@@ -21,14 +21,14 @@ import com.couchbase.client.java.Cluster;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.couchbase.actuate.health.CouchbaseHealthIndicator;
import org.springframework.boot.couchbase.autoconfigure.CouchbaseAutoConfiguration;
import org.springframework.boot.couchbase.health.CouchbaseHealthIndicator;
import org.springframework.boot.health.HealthContributor;
import org.springframework.context.annotation.Bean;
/**

View File

@@ -22,14 +22,14 @@ import reactor.core.publisher.Flux;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.couchbase.actuate.health.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.couchbase.autoconfigure.CouchbaseAutoConfiguration;
import org.springframework.boot.couchbase.health.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.health.ReactiveHealthContributor;
import org.springframework.context.annotation.Bean;
/**

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.couchbase.actuate.health;
package org.springframework.boot.couchbase.health;
import java.util.Collection;
import java.util.HashMap;
@@ -24,7 +24,7 @@ import com.couchbase.client.core.diagnostics.ClusterState;
import com.couchbase.client.core.diagnostics.DiagnosticsResult;
import com.couchbase.client.core.diagnostics.EndpointDiagnostics;
import org.springframework.boot.actuate.health.Health.Builder;
import org.springframework.boot.health.Health;
/**
* Details of Couchbase's health.
@@ -39,7 +39,7 @@ class CouchbaseHealth {
this.diagnostics = diagnostics;
}
void applyTo(Builder builder) {
void applyTo(Health.Builder builder) {
builder = isCouchbaseUp(this.diagnostics) ? builder.up() : builder.down();
builder.withDetail("sdk", this.diagnostics.sdk());
builder.withDetail("endpoints",

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.boot.couchbase.actuate.health;
package org.springframework.boot.couchbase.health;
import com.couchbase.client.core.diagnostics.DiagnosticsResult;
import com.couchbase.client.java.Cluster;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.health.AbstractHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.util.Assert;
/**

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.boot.couchbase.actuate.health;
package org.springframework.boot.couchbase.health;
import com.couchbase.client.java.Cluster;
import reactor.core.publisher.Mono;
import org.springframework.boot.actuate.health.AbstractReactiveHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.ReactiveHealthIndicator;
import org.springframework.boot.health.AbstractReactiveHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.ReactiveHealthIndicator;
/**
* A {@link ReactiveHealthIndicator} for Couchbase.

View File

@@ -17,4 +17,4 @@
/**
* Health integration for Couchbase.
*/
package org.springframework.boot.couchbase.actuate.health;
package org.springframework.boot.couchbase.health;

View File

@@ -21,8 +21,8 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.couchbase.actuate.health.CouchbaseHealthIndicator;
import org.springframework.boot.couchbase.actuate.health.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.couchbase.health.CouchbaseHealthIndicator;
import org.springframework.boot.couchbase.health.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -21,8 +21,8 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.couchbase.actuate.health.CouchbaseHealthIndicator;
import org.springframework.boot.couchbase.actuate.health.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.couchbase.health.CouchbaseHealthIndicator;
import org.springframework.boot.couchbase.health.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.couchbase.actuate.health;
package org.springframework.boot.couchbase.health;
import java.util.Arrays;
import java.util.Collections;
@@ -30,8 +30,8 @@ import com.couchbase.client.core.service.ServiceType;
import com.couchbase.client.java.Cluster;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.couchbase.actuate.health;
package org.springframework.boot.couchbase.health;
import java.time.Duration;
import java.util.Arrays;
@@ -33,8 +33,8 @@ import com.couchbase.client.java.ReactiveCluster;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Mono;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.Status;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;

View File

@@ -21,14 +21,14 @@ import reactor.core.publisher.Flux;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.data.elasticsearch.actuate.health.ElasticsearchReactiveHealthIndicator;
import org.springframework.boot.data.elasticsearch.health.ElasticsearchReactiveHealthIndicator;
import org.springframework.boot.elasticsearch.autoconfigure.ReactiveElasticsearchClientAutoConfiguration;
import org.springframework.boot.health.ReactiveHealthContributor;
import org.springframework.context.annotation.Bean;
import org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchClient;

View File

@@ -14,16 +14,16 @@
* limitations under the License.
*/
package org.springframework.boot.data.elasticsearch.actuate.health;
package org.springframework.boot.data.elasticsearch.health;
import co.elastic.clients.elasticsearch._types.HealthStatus;
import co.elastic.clients.elasticsearch.cluster.HealthResponse;
import reactor.core.publisher.Mono;
import org.springframework.boot.actuate.health.AbstractReactiveHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.AbstractReactiveHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.boot.health.Status;
import org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchClient;
/**

View File

@@ -17,4 +17,4 @@
/**
* Elasticsearch health integration using Spring Data Elasticsearch.
*/
package org.springframework.boot.data.elasticsearch.actuate.health;
package org.springframework.boot.data.elasticsearch.health;

View File

@@ -20,12 +20,12 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.data.elasticsearch.actuate.health.ElasticsearchReactiveHealthIndicator;
import org.springframework.boot.data.elasticsearch.autoconfigure.ElasticsearchDataAutoConfiguration;
import org.springframework.boot.elasticsearch.actuate.health.ElasticsearchRestClientHealthIndicator;
import org.springframework.boot.data.elasticsearch.health.ElasticsearchReactiveHealthIndicator;
import org.springframework.boot.elasticsearch.autoconfigure.ElasticsearchRestClientAutoConfiguration;
import org.springframework.boot.elasticsearch.autoconfigure.ReactiveElasticsearchClientAutoConfiguration;
import org.springframework.boot.elasticsearch.autoconfigure.health.ElasticsearchRestHealthContributorAutoConfiguration;
import org.springframework.boot.elasticsearch.health.ElasticsearchRestClientHealthIndicator;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.data.elasticsearch.actuate.health;
package org.springframework.boot.data.elasticsearch.health;
import java.time.Duration;
import java.util.Map;
@@ -30,8 +30,8 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.Status;
import org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchClient;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.data.mongodb.actuate.health;
package org.springframework.boot.data.mongodb.health;
import com.mongodb.ConnectionString;
import com.mongodb.MongoClientSettings;
@@ -28,8 +28,8 @@ import org.testcontainers.containers.MongoDBContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.Status;
import org.springframework.boot.testsupport.container.TestImage;
import org.springframework.data.mongodb.core.MongoTemplate;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.data.mongodb.actuate.health;
package org.springframework.boot.data.mongodb.health;
import java.time.Duration;
@@ -30,8 +30,8 @@ import org.testcontainers.containers.MongoDBContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.Status;
import org.springframework.boot.testsupport.container.TestImage;
import org.springframework.data.mongodb.core.ReactiveMongoTemplate;

View File

@@ -19,14 +19,14 @@ package org.springframework.boot.data.mongodb.autoconfigure.health;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.data.mongodb.actuate.health.MongoHealthIndicator;
import org.springframework.boot.data.mongodb.autoconfigure.MongoDataAutoConfiguration;
import org.springframework.boot.data.mongodb.health.MongoHealthIndicator;
import org.springframework.boot.health.HealthContributor;
import org.springframework.boot.mongodb.autoconfigure.MongoAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.data.mongodb.core.MongoTemplate;

View File

@@ -21,14 +21,14 @@ import reactor.core.publisher.Flux;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.data.mongodb.actuate.health.MongoReactiveHealthIndicator;
import org.springframework.boot.data.mongodb.autoconfigure.MongoReactiveDataAutoConfiguration;
import org.springframework.boot.data.mongodb.health.MongoReactiveHealthIndicator;
import org.springframework.boot.health.ReactiveHealthContributor;
import org.springframework.context.annotation.Bean;
import org.springframework.data.mongodb.core.ReactiveMongoTemplate;

View File

@@ -14,13 +14,13 @@
* limitations under the License.
*/
package org.springframework.boot.data.mongodb.actuate.health;
package org.springframework.boot.data.mongodb.health;
import org.bson.Document;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.health.AbstractHealthIndicator;
import org.springframework.boot.health.Health;
import org.springframework.boot.health.HealthIndicator;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.util.Assert;

Some files were not shown because too many files have changed in this diff Show More