Migrate HealthIndicator auto-configurations

Migrate all `HealthIndicator` configuration to `HealthContributor`
configurations instead.

See gh-14022
pull/17939/head
Phillip Webb 5 years ago
parent 3c535e0de3
commit f09e0264d9

@ -20,10 +20,10 @@ import java.util.Map;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.boot.actuate.amqp.RabbitHealthIndicator; import org.springframework.boot.actuate.amqp.RabbitHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -44,15 +44,15 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(RabbitTemplate.class) @ConditionalOnClass(RabbitTemplate.class)
@ConditionalOnBean(RabbitTemplate.class) @ConditionalOnBean(RabbitTemplate.class)
@ConditionalOnEnabledHealthIndicator("rabbit") @ConditionalOnEnabledHealthIndicator("rabbit")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(RabbitAutoConfiguration.class) @AutoConfigureAfter(RabbitAutoConfiguration.class)
public class RabbitHealthIndicatorAutoConfiguration public class RabbitHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<RabbitHealthIndicator, RabbitTemplate> { extends CompositeHealthContributorConfiguration<RabbitHealthIndicator, RabbitTemplate> {
@Bean @Bean
@ConditionalOnMissingBean(name = "rabbitHealthIndicator") @ConditionalOnMissingBean(name = { "rabbitHealthIndicator", "rabbitHealthContributor" })
public HealthIndicator rabbitHealthIndicator(Map<String, RabbitTemplate> rabbitTemplates) { public HealthContributor rabbitHealthContributor(Map<String, RabbitTemplate> rabbitTemplates) {
return createHealthIndicator(rabbitTemplates); return createContributor(rabbitTemplates);
} }
} }

@ -20,11 +20,11 @@ import java.util.Map;
import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Cluster;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.cassandra.CassandraHealthIndicator; import org.springframework.boot.actuate.cassandra.CassandraHealthIndicator;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -49,16 +49,15 @@ import org.springframework.data.cassandra.core.CassandraOperations;
@ConditionalOnClass({ Cluster.class, CassandraOperations.class }) @ConditionalOnClass({ Cluster.class, CassandraOperations.class })
@ConditionalOnBean(CassandraOperations.class) @ConditionalOnBean(CassandraOperations.class)
@ConditionalOnEnabledHealthIndicator("cassandra") @ConditionalOnEnabledHealthIndicator("cassandra")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter({ CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class, @AutoConfigureAfter({ CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class })
CassandraReactiveHealthIndicatorAutoConfiguration.class }) public class CassandraHealthContributorAutoConfiguration
public class CassandraHealthIndicatorAutoConfiguration extends CompositeHealthContributorConfiguration<CassandraHealthIndicator, CassandraOperations> {
extends CompositeHealthIndicatorConfiguration<CassandraHealthIndicator, CassandraOperations> {
@Bean @Bean
@ConditionalOnMissingBean(name = "cassandraHealthIndicator") @ConditionalOnMissingBean(name = { "cassandraHealthIndicator", "cassandraHealthContributor" })
public HealthIndicator cassandraHealthIndicator(Map<String, CassandraOperations> cassandraOperations) { public HealthContributor cassandraHealthContributor(Map<String, CassandraOperations> cassandraOperations) {
return createHealthIndicator(cassandraOperations); return createContributor(cassandraOperations);
} }
} }

@ -20,11 +20,11 @@ import java.util.Map;
import com.datastax.driver.core.Cluster; import com.datastax.driver.core.Cluster;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.cassandra.CassandraReactiveHealthIndicator; import org.springframework.boot.actuate.cassandra.CassandraReactiveHealthIndicator;
import org.springframework.boot.actuate.health.ReactiveHealthIndicator; import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -48,16 +48,16 @@ import org.springframework.data.cassandra.core.ReactiveCassandraOperations;
@ConditionalOnClass({ Cluster.class, ReactiveCassandraOperations.class, Flux.class }) @ConditionalOnClass({ Cluster.class, ReactiveCassandraOperations.class, Flux.class })
@ConditionalOnBean(ReactiveCassandraOperations.class) @ConditionalOnBean(ReactiveCassandraOperations.class)
@ConditionalOnEnabledHealthIndicator("cassandra") @ConditionalOnEnabledHealthIndicator("cassandra")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(CassandraReactiveDataAutoConfiguration.class) @AutoConfigureAfter(CassandraReactiveDataAutoConfiguration.class)
public class CassandraReactiveHealthIndicatorAutoConfiguration extends public class CassandraReactiveHealthContributorAutoConfiguration extends
CompositeReactiveHealthIndicatorConfiguration<CassandraReactiveHealthIndicator, ReactiveCassandraOperations> { CompositeReactiveHealthContributorConfiguration<CassandraReactiveHealthIndicator, ReactiveCassandraOperations> {
@Bean @Bean
@ConditionalOnMissingBean(name = "cassandraHealthIndicator") @ConditionalOnMissingBean(name = { "cassandraReactiveHealthIndicator", "cassandraReactiveHealthContributor" })
public ReactiveHealthIndicator cassandraHealthIndicator( public ReactiveHealthContributor cassandraReactiveHealthContributor(
Map<String, ReactiveCassandraOperations> reactiveCassandraOperations) { Map<String, ReactiveCassandraOperations> reactiveCassandraOperations) {
return createHealthIndicator(reactiveCassandraOperations); return createContributor(reactiveCassandraOperations);
} }
} }

@ -19,11 +19,11 @@ import java.util.Map;
import com.couchbase.client.java.Cluster; import com.couchbase.client.java.Cluster;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.couchbase.CouchbaseHealthIndicator; import org.springframework.boot.actuate.couchbase.CouchbaseHealthIndicator;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -47,20 +47,15 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(Cluster.class) @ConditionalOnClass(Cluster.class)
@ConditionalOnBean(Cluster.class) @ConditionalOnBean(Cluster.class)
@ConditionalOnEnabledHealthIndicator("couchbase") @ConditionalOnEnabledHealthIndicator("couchbase")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(CouchbaseAutoConfiguration.class) @AutoConfigureAfter({ CouchbaseAutoConfiguration.class })
public class CouchbaseHealthIndicatorAutoConfiguration public class CouchbaseHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<CouchbaseHealthIndicator, Cluster> { extends CompositeHealthContributorConfiguration<CouchbaseHealthIndicator, Cluster> {
@Bean @Bean
@ConditionalOnMissingBean(name = "couchbaseHealthIndicator") @ConditionalOnMissingBean(name = { "couchbaseHealthContributor", "couchbaseHealthContributor" })
public HealthIndicator couchbaseHealthIndicator(Map<String, Cluster> clusters) { public HealthContributor couchbaseHealthContributor(Map<String, Cluster> clusters) {
return createHealthIndicator(clusters); return createContributor(clusters);
}
@Override
protected CouchbaseHealthIndicator createHealthIndicator(Cluster cluster) {
return new CouchbaseHealthIndicator(cluster);
} }
} }

@ -20,11 +20,11 @@ import java.util.Map;
import com.couchbase.client.java.Cluster; import com.couchbase.client.java.Cluster;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.couchbase.CouchbaseReactiveHealthIndicator; import org.springframework.boot.actuate.couchbase.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.actuate.health.ReactiveHealthIndicator; import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -47,20 +47,15 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass({ Cluster.class, Flux.class }) @ConditionalOnClass({ Cluster.class, Flux.class })
@ConditionalOnBean(Cluster.class) @ConditionalOnBean(Cluster.class)
@ConditionalOnEnabledHealthIndicator("couchbase") @ConditionalOnEnabledHealthIndicator("couchbase")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(CouchbaseAutoConfiguration.class) @AutoConfigureAfter(CouchbaseAutoConfiguration.class)
public class CouchbaseReactiveHealthIndicatorAutoConfiguration public class CouchbaseReactiveHealthContributorAutoConfiguration
extends CompositeReactiveHealthIndicatorConfiguration<CouchbaseReactiveHealthIndicator, Cluster> { extends CompositeReactiveHealthContributorConfiguration<CouchbaseReactiveHealthIndicator, Cluster> {
@Bean @Bean
@ConditionalOnMissingBean(name = "couchbaseReactiveHealthIndicator") @ConditionalOnMissingBean(name = { "couchbaseReactiveHealthIndicator", "couchbaseReactiveHealthContributor" })
public ReactiveHealthIndicator couchbaseReactiveHealthIndicator(Map<String, Cluster> clusters) { public ReactiveHealthContributor couchbaseReactiveHealthContributor(Map<String, Cluster> clusters) {
return createHealthIndicator(clusters); return createContributor(clusters);
}
@Override
protected CouchbaseReactiveHealthIndicator createHealthIndicator(Cluster cluster) {
return new CouchbaseReactiveHealthIndicator(cluster);
} }
} }

@ -21,11 +21,11 @@ import java.util.Map;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.elasticsearch.ElasticsearchHealthIndicator; import org.springframework.boot.actuate.elasticsearch.ElasticsearchHealthIndicator;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -50,27 +50,27 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(Client.class) @ConditionalOnClass(Client.class)
@ConditionalOnBean(Client.class) @ConditionalOnBean(Client.class)
@ConditionalOnEnabledHealthIndicator("elasticsearch") @ConditionalOnEnabledHealthIndicator("elasticsearch")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(ElasticsearchAutoConfiguration.class) @AutoConfigureAfter(ElasticsearchAutoConfiguration.class)
@EnableConfigurationProperties(ElasticsearchHealthIndicatorProperties.class) @EnableConfigurationProperties(ElasticsearchHealthIndicatorProperties.class)
@Deprecated @Deprecated
public class ElasticSearchClientHealthIndicatorAutoConfiguration public class ElasticSearchClientHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<ElasticsearchHealthIndicator, Client> { extends CompositeHealthContributorConfiguration<ElasticsearchHealthIndicator, Client> {
private final ElasticsearchHealthIndicatorProperties properties; private final ElasticsearchHealthIndicatorProperties properties;
public ElasticSearchClientHealthIndicatorAutoConfiguration(ElasticsearchHealthIndicatorProperties properties) { public ElasticSearchClientHealthContributorAutoConfiguration(ElasticsearchHealthIndicatorProperties properties) {
this.properties = properties; this.properties = properties;
} }
@Bean @Bean
@ConditionalOnMissingBean(name = "elasticsearchHealthIndicator") @ConditionalOnMissingBean(name = { "elasticsearchHealthIndicator", "elasticsearchHealthContributor" })
public HealthIndicator elasticsearchHealthIndicator(Map<String, Client> clients) { public HealthContributor elasticsearchHealthContributor(Map<String, Client> clients) {
return createHealthIndicator(clients); return createContributor(clients);
} }
@Override @Override
protected ElasticsearchHealthIndicator createHealthIndicator(Client client) { protected ElasticsearchHealthIndicator createIndicator(Client client) {
Duration responseTimeout = this.properties.getResponseTimeout(); Duration responseTimeout = this.properties.getResponseTimeout();
return new ElasticsearchHealthIndicator(client, (responseTimeout != null) ? responseTimeout.toMillis() : 100, return new ElasticsearchHealthIndicator(client, (responseTimeout != null) ? responseTimeout.toMillis() : 100,
this.properties.getIndices()); this.properties.getIndices());

@ -20,12 +20,12 @@ import java.util.Map;
import io.searchbox.client.JestClient; import io.searchbox.client.JestClient;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.elasticsearch.ElasticsearchHealthIndicator; import org.springframework.boot.actuate.elasticsearch.ElasticsearchHealthIndicator;
import org.springframework.boot.actuate.elasticsearch.ElasticsearchJestHealthIndicator; import org.springframework.boot.actuate.elasticsearch.ElasticsearchJestHealthIndicator;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -47,21 +47,16 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(JestClient.class) @ConditionalOnClass(JestClient.class)
@ConditionalOnBean(JestClient.class) @ConditionalOnBean(JestClient.class)
@ConditionalOnEnabledHealthIndicator("elasticsearch") @ConditionalOnEnabledHealthIndicator("elasticsearch")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter({ JestAutoConfiguration.class, ElasticSearchClientHealthIndicatorAutoConfiguration.class }) @AutoConfigureAfter({ JestAutoConfiguration.class, ElasticSearchClientHealthContributorAutoConfiguration.class })
@Deprecated @Deprecated
public class ElasticSearchJestHealthIndicatorAutoConfiguration public class ElasticSearchJestHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<ElasticsearchJestHealthIndicator, JestClient> { extends CompositeHealthContributorConfiguration<ElasticsearchJestHealthIndicator, JestClient> {
@Bean @Bean
@ConditionalOnMissingBean(name = "elasticsearchHealthIndicator") @ConditionalOnMissingBean(name = { "elasticsearchHealthIndicator", "elasticsearchHealthContributor" })
public HealthIndicator elasticsearchHealthIndicator(Map<String, JestClient> clients) { public HealthContributor elasticsearchHealthContributor(Map<String, JestClient> clients) {
return createHealthIndicator(clients); return createContributor(clients);
}
@Override
protected ElasticsearchJestHealthIndicator createHealthIndicator(JestClient client) {
return new ElasticsearchJestHealthIndicator(client);
} }
} }

@ -20,11 +20,11 @@ import java.util.Map;
import org.elasticsearch.client.RestClient; import org.elasticsearch.client.RestClient;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.elasticsearch.ElasticsearchRestHealthIndicator; import org.springframework.boot.actuate.elasticsearch.ElasticsearchRestHealthIndicator;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -46,21 +46,16 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(RestClient.class) @ConditionalOnClass(RestClient.class)
@ConditionalOnBean(RestClient.class) @ConditionalOnBean(RestClient.class)
@ConditionalOnEnabledHealthIndicator("elasticsearch") @ConditionalOnEnabledHealthIndicator("elasticsearch")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter({ RestClientAutoConfiguration.class, ElasticSearchClientHealthIndicatorAutoConfiguration.class }) @AutoConfigureAfter({ RestClientAutoConfiguration.class, ElasticSearchClientHealthContributorAutoConfiguration.class })
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class ElasticSearchRestHealthIndicatorAutoConfiguration public class ElasticSearchRestHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<ElasticsearchRestHealthIndicator, RestClient> { extends CompositeHealthContributorConfiguration<ElasticsearchRestHealthIndicator, RestClient> {
@Bean @Bean
@ConditionalOnMissingBean(name = "elasticsearchRestHealthIndicator") @ConditionalOnMissingBean(name = { "elasticsearchRestHealthIndicator", "elasticsearchRestHealthContributor" })
public HealthIndicator elasticsearchRestHealthIndicator(Map<String, RestClient> clients) { public HealthContributor elasticsearchRestHealthContributor(Map<String, RestClient> clients) {
return createHealthIndicator(clients); return createContributor(clients);
}
@Override
protected ElasticsearchRestHealthIndicator createHealthIndicator(RestClient client) {
return new ElasticsearchRestHealthIndicator(client);
} }
} }

@ -20,11 +20,11 @@ import java.util.Map;
import com.hazelcast.core.HazelcastInstance; import com.hazelcast.core.HazelcastInstance;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.hazelcast.HazelcastHealthIndicator; import org.springframework.boot.actuate.hazelcast.HazelcastHealthIndicator;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -46,15 +46,15 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(HazelcastInstance.class) @ConditionalOnClass(HazelcastInstance.class)
@ConditionalOnBean(HazelcastInstance.class) @ConditionalOnBean(HazelcastInstance.class)
@ConditionalOnEnabledHealthIndicator("hazelcast") @ConditionalOnEnabledHealthIndicator("hazelcast")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(HazelcastAutoConfiguration.class) @AutoConfigureAfter(HazelcastAutoConfiguration.class)
public class HazelcastHealthIndicatorAutoConfiguration public class HazelcastHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<HazelcastHealthIndicator, HazelcastInstance> { extends CompositeHealthContributorConfiguration<HazelcastHealthIndicator, HazelcastInstance> {
@Bean @Bean
@ConditionalOnMissingBean(name = "hazelcastHealthIndicator") @ConditionalOnMissingBean(name = { "hazelcastHealthIndicator", "hazelcastHealthContributor" })
public HealthIndicator hazelcastHealthIndicator(Map<String, HazelcastInstance> hazelcastInstances) { public HealthContributor hazelcastHealthContributor(Map<String, HazelcastInstance> hazelcastInstances) {
return createHealthIndicator(hazelcastInstances); return createContributor(hazelcastInstances);
} }
} }

@ -20,10 +20,10 @@ import java.util.Map;
import org.influxdb.InfluxDB; import org.influxdb.InfluxDB;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.influx.InfluxDbHealthIndicator; import org.springframework.boot.actuate.influx.InfluxDbHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
@ -45,15 +45,15 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(InfluxDB.class) @ConditionalOnClass(InfluxDB.class)
@ConditionalOnBean(InfluxDB.class) @ConditionalOnBean(InfluxDB.class)
@ConditionalOnEnabledHealthIndicator("influxdb") @ConditionalOnEnabledHealthIndicator("influxdb")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(InfluxDbAutoConfiguration.class) @AutoConfigureAfter(InfluxDbAutoConfiguration.class)
public class InfluxDbHealthIndicatorAutoConfiguration public class InfluxDbHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<InfluxDbHealthIndicator, InfluxDB> { extends CompositeHealthContributorConfiguration<InfluxDbHealthIndicator, InfluxDB> {
@Bean @Bean
@ConditionalOnMissingBean(name = "influxDbHealthIndicator") @ConditionalOnMissingBean(name = { "influxDbHealthIndicator", "influxDbHealthContributor" })
public HealthIndicator influxDbHealthIndicator(Map<String, InfluxDB> influxDbs) { public HealthContributor influxDbHealthContributor(Map<String, InfluxDB> influxDbs) {
return createHealthIndicator(influxDbs); return createContributor(influxDbs);
} }
} }

@ -25,10 +25,10 @@ import javax.sql.DataSource;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator; import org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
@ -60,16 +60,16 @@ import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
@ConditionalOnClass({ JdbcTemplate.class, AbstractRoutingDataSource.class }) @ConditionalOnClass({ JdbcTemplate.class, AbstractRoutingDataSource.class })
@ConditionalOnBean(DataSource.class) @ConditionalOnBean(DataSource.class)
@ConditionalOnEnabledHealthIndicator("db") @ConditionalOnEnabledHealthIndicator("db")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(DataSourceAutoConfiguration.class) @AutoConfigureAfter(DataSourceAutoConfiguration.class)
public class DataSourceHealthIndicatorAutoConfiguration extends public class DataSourceHealthContributorAutoConfiguration extends
CompositeHealthIndicatorConfiguration<DataSourceHealthIndicator, DataSource> implements InitializingBean { CompositeHealthContributorConfiguration<DataSourceHealthIndicator, DataSource> implements InitializingBean {
private final Collection<DataSourcePoolMetadataProvider> metadataProviders; private final Collection<DataSourcePoolMetadataProvider> metadataProviders;
private DataSourcePoolMetadataProvider poolMetadataProvider; private DataSourcePoolMetadataProvider poolMetadataProvider;
public DataSourceHealthIndicatorAutoConfiguration(Map<String, DataSource> dataSources, public DataSourceHealthContributorAutoConfiguration(Map<String, DataSource> dataSources,
ObjectProvider<DataSourcePoolMetadataProvider> metadataProviders) { ObjectProvider<DataSourcePoolMetadataProvider> metadataProviders) {
this.metadataProviders = metadataProviders.orderedStream().collect(Collectors.toList()); this.metadataProviders = metadataProviders.orderedStream().collect(Collectors.toList());
} }
@ -80,9 +80,9 @@ public class DataSourceHealthIndicatorAutoConfiguration extends
} }
@Bean @Bean
@ConditionalOnMissingBean(name = "dbHealthIndicator") @ConditionalOnMissingBean(name = { "dbHealthIndicator", "dbHealthContributor" })
public HealthIndicator dbHealthIndicator(Map<String, DataSource> dataSources) { public HealthContributor dbHealthContributor(Map<String, DataSource> dataSources) {
return createHealthIndicator(filterDataSources(dataSources)); return createContributor(filterDataSources(dataSources));
} }
private Map<String, DataSource> filterDataSources(Map<String, DataSource> candidates) { private Map<String, DataSource> filterDataSources(Map<String, DataSource> candidates) {
@ -99,7 +99,7 @@ public class DataSourceHealthIndicatorAutoConfiguration extends
} }
@Override @Override
protected DataSourceHealthIndicator createHealthIndicator(DataSource source) { protected DataSourceHealthIndicator createIndicator(DataSource source) {
return new DataSourceHealthIndicator(source, getValidationQuery(source)); return new DataSourceHealthIndicator(source, getValidationQuery(source));
} }

@ -20,10 +20,10 @@ import java.util.Map;
import javax.jms.ConnectionFactory; import javax.jms.ConnectionFactory;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.jms.JmsHealthIndicator; import org.springframework.boot.actuate.jms.JmsHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
@ -46,15 +46,15 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(ConnectionFactory.class) @ConditionalOnClass(ConnectionFactory.class)
@ConditionalOnBean(ConnectionFactory.class) @ConditionalOnBean(ConnectionFactory.class)
@ConditionalOnEnabledHealthIndicator("jms") @ConditionalOnEnabledHealthIndicator("jms")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter({ ActiveMQAutoConfiguration.class, ArtemisAutoConfiguration.class }) @AutoConfigureAfter({ ActiveMQAutoConfiguration.class, ArtemisAutoConfiguration.class })
public class JmsHealthIndicatorAutoConfiguration public class JmsHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<JmsHealthIndicator, ConnectionFactory> { extends CompositeHealthContributorConfiguration<JmsHealthIndicator, ConnectionFactory> {
@Bean @Bean
@ConditionalOnMissingBean(name = "jmsHealthIndicator") @ConditionalOnMissingBean(name = { "jmsHealthIndicator", "jmsHealthContributor" })
public HealthIndicator jmsHealthIndicator(Map<String, ConnectionFactory> connectionFactories) { public HealthContributor jmsHealthContributor(Map<String, ConnectionFactory> connectionFactories) {
return createHealthIndicator(connectionFactories); return createContributor(connectionFactories);
} }
} }

@ -18,10 +18,10 @@ package org.springframework.boot.actuate.autoconfigure.ldap;
import java.util.Map; import java.util.Map;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.ldap.LdapHealthIndicator; import org.springframework.boot.actuate.ldap.LdapHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
@ -45,15 +45,15 @@ import org.springframework.ldap.core.LdapOperations;
@ConditionalOnClass(LdapOperations.class) @ConditionalOnClass(LdapOperations.class)
@ConditionalOnBean(LdapOperations.class) @ConditionalOnBean(LdapOperations.class)
@ConditionalOnEnabledHealthIndicator("ldap") @ConditionalOnEnabledHealthIndicator("ldap")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(LdapAutoConfiguration.class) @AutoConfigureAfter(LdapAutoConfiguration.class)
public class LdapHealthIndicatorAutoConfiguration public class LdapHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<LdapHealthIndicator, LdapOperations> { extends CompositeHealthContributorConfiguration<LdapHealthIndicator, LdapOperations> {
@Bean @Bean
@ConditionalOnMissingBean(name = "ldapHealthIndicator") @ConditionalOnMissingBean(name = { "ldapHealthIndicator", "ldapHealthContributor" })
public HealthIndicator ldapHealthIndicator(Map<String, LdapOperations> ldapOperations) { public HealthContributor ldapHealthContributor(Map<String, LdapOperations> ldapOperations) {
return createHealthIndicator(ldapOperations); return createContributor(ldapOperations);
} }
} }

@ -18,10 +18,10 @@ package org.springframework.boot.actuate.autoconfigure.mail;
import java.util.Map; import java.util.Map;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.mail.MailHealthIndicator; import org.springframework.boot.actuate.mail.MailHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
@ -44,15 +44,15 @@ import org.springframework.mail.javamail.JavaMailSenderImpl;
@ConditionalOnClass(JavaMailSenderImpl.class) @ConditionalOnClass(JavaMailSenderImpl.class)
@ConditionalOnBean(JavaMailSenderImpl.class) @ConditionalOnBean(JavaMailSenderImpl.class)
@ConditionalOnEnabledHealthIndicator("mail") @ConditionalOnEnabledHealthIndicator("mail")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(MailSenderAutoConfiguration.class) @AutoConfigureAfter(MailSenderAutoConfiguration.class)
public class MailHealthIndicatorAutoConfiguration public class MailHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<MailHealthIndicator, JavaMailSenderImpl> { extends CompositeHealthContributorConfiguration<MailHealthIndicator, JavaMailSenderImpl> {
@Bean @Bean
@ConditionalOnMissingBean(name = "mailHealthIndicator") @ConditionalOnMissingBean(name = { "mailHealthIndicator", "mailHealthContributor" })
public HealthIndicator mailHealthIndicator(Map<String, JavaMailSenderImpl> mailSenders) { public HealthContributor mailHealthContributor(Map<String, JavaMailSenderImpl> mailSenders) {
return createHealthIndicator(mailSenders); return createContributor(mailSenders);
} }
} }

@ -18,10 +18,10 @@ package org.springframework.boot.actuate.autoconfigure.mongo;
import java.util.Map; import java.util.Map;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.mongo.MongoHealthIndicator; import org.springframework.boot.actuate.mongo.MongoHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
@ -45,16 +45,15 @@ import org.springframework.data.mongodb.core.MongoTemplate;
@ConditionalOnClass(MongoTemplate.class) @ConditionalOnClass(MongoTemplate.class)
@ConditionalOnBean(MongoTemplate.class) @ConditionalOnBean(MongoTemplate.class)
@ConditionalOnEnabledHealthIndicator("mongo") @ConditionalOnEnabledHealthIndicator("mongo")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter({ MongoAutoConfiguration.class, MongoDataAutoConfiguration.class, @AutoConfigureAfter({ MongoAutoConfiguration.class, MongoDataAutoConfiguration.class })
MongoReactiveHealthIndicatorAutoConfiguration.class }) public class MongoHealthContributorAutoConfiguration
public class MongoHealthIndicatorAutoConfiguration extends CompositeHealthContributorConfiguration<MongoHealthIndicator, MongoTemplate> {
extends CompositeHealthIndicatorConfiguration<MongoHealthIndicator, MongoTemplate> {
@Bean @Bean
@ConditionalOnMissingBean(name = "mongoHealthIndicator") @ConditionalOnMissingBean(name = { "mongoHealthIndicator", "mongoHealthContributor" })
public HealthIndicator mongoHealthIndicator(Map<String, MongoTemplate> mongoTemplates) { public HealthContributor mongoHealthContributor(Map<String, MongoTemplate> mongoTemplates) {
return createHealthIndicator(mongoTemplates); return createContributor(mongoTemplates);
} }
} }

@ -20,10 +20,10 @@ import java.util.Map;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.ReactiveHealthIndicator; import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.actuate.mongo.MongoReactiveHealthIndicator; import org.springframework.boot.actuate.mongo.MongoReactiveHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
@ -47,15 +47,16 @@ import org.springframework.data.mongodb.core.ReactiveMongoTemplate;
@ConditionalOnClass({ ReactiveMongoTemplate.class, Flux.class }) @ConditionalOnClass({ ReactiveMongoTemplate.class, Flux.class })
@ConditionalOnBean(ReactiveMongoTemplate.class) @ConditionalOnBean(ReactiveMongoTemplate.class)
@ConditionalOnEnabledHealthIndicator("mongo") @ConditionalOnEnabledHealthIndicator("mongo")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(MongoReactiveDataAutoConfiguration.class) @AutoConfigureAfter(MongoReactiveDataAutoConfiguration.class)
public class MongoReactiveHealthIndicatorAutoConfiguration public class MongoReactiveHealthContributorAutoConfiguration
extends CompositeReactiveHealthIndicatorConfiguration<MongoReactiveHealthIndicator, ReactiveMongoTemplate> { extends CompositeReactiveHealthContributorConfiguration<MongoReactiveHealthIndicator, ReactiveMongoTemplate> {
@Bean @Bean
@ConditionalOnMissingBean(name = "mongoHealthIndicator") @ConditionalOnMissingBean(name = { "mongoReactiveHealthIndicator", "mongoReactiveHealthContributor" })
public ReactiveHealthIndicator mongoHealthIndicator(Map<String, ReactiveMongoTemplate> reactiveMongoTemplates) { public ReactiveHealthContributor mongoReactiveHealthContributor(
return createHealthIndicator(reactiveMongoTemplates); Map<String, ReactiveMongoTemplate> reactiveMongoTemplates) {
return createContributor(reactiveMongoTemplates);
} }
} }

@ -20,10 +20,10 @@ import java.util.Map;
import org.neo4j.ogm.session.SessionFactory; import org.neo4j.ogm.session.SessionFactory;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.neo4j.Neo4jHealthIndicator; import org.springframework.boot.actuate.neo4j.Neo4jHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
@ -46,15 +46,15 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(SessionFactory.class) @ConditionalOnClass(SessionFactory.class)
@ConditionalOnBean(SessionFactory.class) @ConditionalOnBean(SessionFactory.class)
@ConditionalOnEnabledHealthIndicator("neo4j") @ConditionalOnEnabledHealthIndicator("neo4j")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(Neo4jDataAutoConfiguration.class) @AutoConfigureAfter(Neo4jDataAutoConfiguration.class)
public class Neo4jHealthIndicatorAutoConfiguration public class Neo4jHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<Neo4jHealthIndicator, SessionFactory> { extends CompositeHealthContributorConfiguration<Neo4jHealthIndicator, SessionFactory> {
@Bean @Bean
@ConditionalOnMissingBean(name = "neo4jHealthIndicator") @ConditionalOnMissingBean(name = { "neo4jHealthIndicator", "neo4jHealthContributor" })
public HealthIndicator neo4jHealthIndicator(Map<String, SessionFactory> sessionFactories) { public HealthContributor neo4jHealthContributor(Map<String, SessionFactory> sessionFactories) {
return createHealthIndicator(sessionFactories); return createContributor(sessionFactories);
} }
} }

@ -18,10 +18,10 @@ package org.springframework.boot.actuate.autoconfigure.redis;
import java.util.Map; import java.util.Map;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.redis.RedisHealthIndicator; import org.springframework.boot.actuate.redis.RedisHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
@ -47,15 +47,15 @@ import org.springframework.data.redis.connection.RedisConnectionFactory;
@ConditionalOnClass(RedisConnectionFactory.class) @ConditionalOnClass(RedisConnectionFactory.class)
@ConditionalOnBean(RedisConnectionFactory.class) @ConditionalOnBean(RedisConnectionFactory.class)
@ConditionalOnEnabledHealthIndicator("redis") @ConditionalOnEnabledHealthIndicator("redis")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter({ RedisAutoConfiguration.class, RedisReactiveHealthIndicatorAutoConfiguration.class }) @AutoConfigureAfter(RedisAutoConfiguration.class)
public class RedisHealthIndicatorAutoConfiguration public class RedisHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<RedisHealthIndicator, RedisConnectionFactory> { extends CompositeHealthContributorConfiguration<RedisHealthIndicator, RedisConnectionFactory> {
@Bean @Bean
@ConditionalOnMissingBean(name = "redisHealthIndicator") @ConditionalOnMissingBean(name = { "redisHealthIndicator", "redisHealthContributor" })
public HealthIndicator redisHealthIndicator(Map<String, RedisConnectionFactory> redisConnectionFactories) { public HealthContributor redisHealthContributor(Map<String, RedisConnectionFactory> redisConnectionFactories) {
return createHealthIndicator(redisConnectionFactories); return createContributor(redisConnectionFactories);
} }
} }

@ -20,10 +20,10 @@ import java.util.Map;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.ReactiveHealthIndicator; import org.springframework.boot.actuate.health.ReactiveHealthContributor;
import org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator; import org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
@ -50,22 +50,22 @@ import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
@ConditionalOnClass({ ReactiveRedisConnectionFactory.class, Flux.class }) @ConditionalOnClass({ ReactiveRedisConnectionFactory.class, Flux.class })
@ConditionalOnBean(ReactiveRedisConnectionFactory.class) @ConditionalOnBean(ReactiveRedisConnectionFactory.class)
@ConditionalOnEnabledHealthIndicator("redis") @ConditionalOnEnabledHealthIndicator("redis")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(RedisReactiveAutoConfiguration.class) @AutoConfigureAfter(RedisReactiveAutoConfiguration.class)
public class RedisReactiveHealthIndicatorAutoConfiguration extends public class RedisReactiveHealthContributorAutoConfiguration extends
CompositeReactiveHealthIndicatorConfiguration<RedisReactiveHealthIndicator, ReactiveRedisConnectionFactory> { CompositeReactiveHealthContributorConfiguration<RedisReactiveHealthIndicator, ReactiveRedisConnectionFactory> {
private final Map<String, ReactiveRedisConnectionFactory> redisConnectionFactories; private final Map<String, ReactiveRedisConnectionFactory> redisConnectionFactories;
RedisReactiveHealthIndicatorAutoConfiguration( RedisReactiveHealthContributorAutoConfiguration(
Map<String, ReactiveRedisConnectionFactory> redisConnectionFactories) { Map<String, ReactiveRedisConnectionFactory> redisConnectionFactories) {
this.redisConnectionFactories = redisConnectionFactories; this.redisConnectionFactories = redisConnectionFactories;
} }
@Bean @Bean
@ConditionalOnMissingBean(name = "redisHealthIndicator") @ConditionalOnMissingBean(name = { "redisReactiveHealthIndicator", "redisReactiveHealthContributor" })
public ReactiveHealthIndicator redisHealthIndicator() { public ReactiveHealthContributor redisReactiveHealthContributor() {
return createHealthIndicator(this.redisConnectionFactories); return createContributor(this.redisConnectionFactories);
} }
} }

@ -20,10 +20,10 @@ import java.util.Map;
import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrClient;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthIndicatorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthContributor;
import org.springframework.boot.actuate.solr.SolrHealthIndicator; import org.springframework.boot.actuate.solr.SolrHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
@ -46,15 +46,15 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(SolrClient.class) @ConditionalOnClass(SolrClient.class)
@ConditionalOnBean(SolrClient.class) @ConditionalOnBean(SolrClient.class)
@ConditionalOnEnabledHealthIndicator("solr") @ConditionalOnEnabledHealthIndicator("solr")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(SolrAutoConfiguration.class) @AutoConfigureAfter(SolrAutoConfiguration.class)
public class SolrHealthIndicatorAutoConfiguration public class SolrHealthContributorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<SolrHealthIndicator, SolrClient> { extends CompositeHealthContributorConfiguration<SolrHealthIndicator, SolrClient> {
@Bean @Bean
@ConditionalOnMissingBean(name = "solrHealthIndicator") @ConditionalOnMissingBean(name = { "solrHealthIndicator", "solrHealthContributor" })
public HealthIndicator solrHealthIndicator(Map<String, SolrClient> solrClients) { public HealthContributor solrHealthContributor(Map<String, SolrClient> solrClients) {
return createHealthIndicator(solrClients); return createContributor(solrClients);
} }
} }

@ -17,11 +17,12 @@
package org.springframework.boot.actuate.autoconfigure.system; package org.springframework.boot.actuate.autoconfigure.system;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.system.DiskSpaceHealthIndicator; import org.springframework.boot.actuate.system.DiskSpaceHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -35,8 +36,9 @@ import org.springframework.context.annotation.Configuration;
*/ */
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
@ConditionalOnEnabledHealthIndicator("diskspace") @ConditionalOnEnabledHealthIndicator("diskspace")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(HealthContributorAutoConfiguration.class)
public class DiskSpaceHealthIndicatorAutoConfiguration { @EnableConfigurationProperties(DiskSpaceHealthIndicatorProperties.class)
public class DiskSpaceHealthContributorAutoConfiguration {
@Bean @Bean
@ConditionalOnMissingBean(name = "diskSpaceHealthIndicator") @ConditionalOnMissingBean(name = "diskSpaceHealthIndicator")
@ -44,9 +46,4 @@ public class DiskSpaceHealthIndicatorAutoConfiguration {
return new DiskSpaceHealthIndicator(properties.getPath(), properties.getThreshold()); return new DiskSpaceHealthIndicator(properties.getPath(), properties.getThreshold());
} }
@Bean
public DiskSpaceHealthIndicatorProperties diskSpaceHealthIndicatorProperties() {
return new DiskSpaceHealthIndicatorProperties();
}
} }

@ -1,21 +1,21 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
org.springframework.boot.actuate.autoconfigure.amqp.RabbitHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.amqp.RabbitHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.audit.AuditAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.audit.AuditAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.cache.CachesEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.cache.CachesEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.cassandra.CassandraHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.cassandra.CassandraHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.cassandra.CassandraReactiveHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.cassandra.CassandraReactiveHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.cloudfoundry.servlet.CloudFoundryActuatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.cloudfoundry.servlet.CloudFoundryActuatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.cloudfoundry.reactive.ReactiveCloudFoundryActuatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.cloudfoundry.reactive.ReactiveCloudFoundryActuatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.context.properties.ConfigurationPropertiesReportEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.context.properties.ConfigurationPropertiesReportEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.context.ShutdownEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.context.ShutdownEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.couchbase.CouchbaseHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.couchbase.CouchbaseHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.couchbase.CouchbaseReactiveHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.couchbase.CouchbaseReactiveHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchClientHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchClientHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchJestHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchJestHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration,\
@ -23,19 +23,19 @@ org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointAutoConfig
org.springframework.boot.actuate.autoconfigure.flyway.FlywayEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.flyway.FlywayEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.influx.InfluxDbHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.influx.InfluxDbHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.info.InfoContributorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.info.InfoContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.integration.IntegrationGraphEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.integration.IntegrationGraphEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.jms.JmsHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.jms.JmsHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.jolokia.JolokiaEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.jolokia.JolokiaEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.ldap.LdapHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.ldap.LdapHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.liquibase.LiquibaseEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.liquibase.LiquibaseEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.logging.LogFileWebEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.logging.LogFileWebEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.logging.LoggersEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.logging.LoggersEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.mail.MailHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.mail.MailHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.management.HeapDumpWebEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.management.HeapDumpWebEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.management.ThreadDumpEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.management.ThreadDumpEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration,\
@ -73,17 +73,17 @@ org.springframework.boot.actuate.autoconfigure.metrics.web.jetty.JettyMetricsAut
org.springframework.boot.actuate.autoconfigure.metrics.web.reactive.WebFluxMetricsAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.metrics.web.reactive.WebFluxMetricsAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.metrics.web.servlet.WebMvcMetricsAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.metrics.web.servlet.WebMvcMetricsAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.metrics.web.tomcat.TomcatMetricsAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.metrics.web.tomcat.TomcatMetricsAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.mongo.MongoHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.mongo.MongoHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.mongo.MongoReactiveHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.mongo.MongoReactiveHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.neo4j.Neo4jHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.neo4j.Neo4jHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.redis.RedisHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.redis.RedisHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.redis.RedisReactiveHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.redis.RedisReactiveHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.security.reactive.ReactiveManagementWebSecurityAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.security.reactive.ReactiveManagementWebSecurityAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.session.SessionsEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.session.SessionsEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.solr.SolrHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.solr.SolrHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthIndicatorAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.web.mappings.MappingsEndpointAutoConfiguration,\ org.springframework.boot.actuate.autoconfigure.web.mappings.MappingsEndpointAutoConfiguration,\

@ -20,8 +20,6 @@ import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.amqp.RabbitHealthIndicator; import org.springframework.boot.actuate.amqp.RabbitHealthIndicator;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration; import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
@ -30,16 +28,15 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link RabbitHealthIndicatorAutoConfiguration}. * Tests for {@link RabbitHealthContributorAutoConfiguration}.
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
class RabbitHealthIndicatorAutoConfigurationTests { class RabbitHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RabbitAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(RabbitAutoConfiguration.class,
RabbitHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, RabbitHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.cassandra;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.cassandra.CassandraHealthIndicator; import org.springframework.boot.actuate.cassandra.CassandraHealthIndicator;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -34,16 +32,15 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link CassandraHealthIndicatorAutoConfiguration}. * Tests for {@link CassandraHealthContributorAutoConfiguration}.
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
class CassandraHealthIndicatorAutoConfigurationTests { class CassandraHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(CassandraConfiguration.class, .withConfiguration(AutoConfigurations.of(CassandraConfiguration.class,
CassandraHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, CassandraHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {
@ -59,7 +56,7 @@ class CassandraHealthIndicatorAutoConfigurationTests {
} }
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
@AutoConfigureBefore(CassandraHealthIndicatorAutoConfiguration.class) @AutoConfigureBefore(CassandraHealthContributorAutoConfiguration.class)
static class CassandraConfiguration { static class CassandraConfiguration {
@Bean @Bean

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.cassandra;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.cassandra.CassandraHealthIndicator; import org.springframework.boot.actuate.cassandra.CassandraHealthIndicator;
import org.springframework.boot.actuate.cassandra.CassandraReactiveHealthIndicator; import org.springframework.boot.actuate.cassandra.CassandraReactiveHealthIndicator;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
@ -32,18 +30,17 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link CassandraReactiveHealthIndicatorAutoConfiguration}. * Tests for {@link CassandraReactiveHealthContributorAutoConfiguration}.
* *
* @author Artsiom Yudovin * @author Artsiom Yudovin
* @author Stephane Nicoll * @author Stephane Nicoll
*/ */
class CassandraReactiveHealthIndicatorAutoConfigurationTests { class CassandraReactiveHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(ReactiveCassandraOperations.class, () -> mock(ReactiveCassandraOperations.class)) .withBean(ReactiveCassandraOperations.class, () -> mock(ReactiveCassandraOperations.class))
.withConfiguration(AutoConfigurations.of(CassandraReactiveHealthIndicatorAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(CassandraReactiveHealthContributorAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class, HealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -19,8 +19,6 @@ import com.couchbase.client.java.Cluster;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.couchbase.CouchbaseHealthIndicator; import org.springframework.boot.actuate.couchbase.CouchbaseHealthIndicator;
import org.springframework.boot.actuate.couchbase.CouchbaseReactiveHealthIndicator; import org.springframework.boot.actuate.couchbase.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
@ -31,18 +29,16 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link CouchbaseHealthIndicatorAutoConfiguration}. * Tests for {@link CouchbaseHealthContributorAutoConfiguration}.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Stephane Nicoll * @author Stephane Nicoll
*/ */
class CouchbaseHealthIndicatorAutoConfigurationTests { class CouchbaseHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(Cluster.class, () -> mock(Cluster.class)) .withBean(Cluster.class, () -> mock(Cluster.class)).withConfiguration(AutoConfigurations
.withConfiguration(AutoConfigurations.of(CouchbaseHealthIndicatorAutoConfiguration.class, .of(CouchbaseHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthIndicatorAutoConfiguration.class, HealthContributorAutoConfiguration.class,
HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -13,14 +13,13 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.actuate.autoconfigure.couchbase; package org.springframework.boot.actuate.autoconfigure.couchbase;
import com.couchbase.client.java.Cluster; import com.couchbase.client.java.Cluster;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.couchbase.CouchbaseHealthIndicator; import org.springframework.boot.actuate.couchbase.CouchbaseHealthIndicator;
import org.springframework.boot.actuate.couchbase.CouchbaseReactiveHealthIndicator; import org.springframework.boot.actuate.couchbase.CouchbaseReactiveHealthIndicator;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
@ -31,17 +30,16 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link CouchbaseReactiveHealthIndicatorAutoConfiguration}. * Tests for {@link CouchbaseReactiveHealthContributorAutoConfiguration}.
* *
* @author Mikalai Lushchytski * @author Mikalai Lushchytski
*/ */
class CouchbaseReactiveHealthIndicatorAutoConfigurationTests { class CouchbaseReactiveHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(Cluster.class, () -> mock(Cluster.class)) .withBean(Cluster.class, () -> mock(Cluster.class))
.withConfiguration(AutoConfigurations.of(CouchbaseReactiveHealthIndicatorAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(CouchbaseReactiveHealthContributorAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class, HealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -20,8 +20,6 @@ import io.searchbox.client.JestClient;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.elasticsearch.ElasticsearchHealthIndicator; import org.springframework.boot.actuate.elasticsearch.ElasticsearchHealthIndicator;
import org.springframework.boot.actuate.elasticsearch.ElasticsearchJestHealthIndicator; import org.springframework.boot.actuate.elasticsearch.ElasticsearchJestHealthIndicator;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
@ -33,18 +31,18 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link ElasticSearchClientHealthIndicatorAutoConfiguration} and * Tests for {@link ElasticSearchClientHealthContributorAutoConfiguration} and
* {@link ElasticSearchJestHealthIndicatorAutoConfiguration}. * {@link ElasticSearchJestHealthContributorAutoConfiguration}.
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
@Deprecated @Deprecated
class ElasticsearchHealthIndicatorAutoConfigurationTests { class ElasticsearchHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(AutoConfigurations private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(AutoConfigurations
.of(ElasticsearchAutoConfiguration.class, ElasticSearchClientHealthIndicatorAutoConfiguration.class, .of(ElasticsearchAutoConfiguration.class, ElasticSearchClientHealthContributorAutoConfiguration.class,
ElasticSearchJestHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, ElasticSearchJestHealthContributorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class)); HealthContributorAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -20,8 +20,6 @@ import com.hazelcast.core.HazelcastInstance;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.hazelcast.HazelcastHealthIndicator; import org.springframework.boot.actuate.hazelcast.HazelcastHealthIndicator;
import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status; import org.springframework.boot.actuate.health.Status;
@ -32,16 +30,15 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Integration tests for {@link HazelcastHealthIndicatorAutoConfiguration}. * Integration tests for {@link HazelcastHealthContributorAutoConfiguration}.
* *
* @author Dmytro Nosan * @author Dmytro Nosan
*/ */
class HazelcastHealthIndicatorAutoConfigurationIntegrationTests { class HazelcastHealthContributorAutoConfigurationIntegrationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(HazelcastHealthIndicatorAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(HazelcastHealthContributorAutoConfiguration.class,
HazelcastAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, HazelcastAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
@Test @Test
void hazelcastUp() { void hazelcastUp() {

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.hazelcast;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.hazelcast.HazelcastHealthIndicator; import org.springframework.boot.actuate.hazelcast.HazelcastHealthIndicator;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -30,16 +28,15 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link HazelcastHealthIndicatorAutoConfiguration}. * Tests for {@link HazelcastHealthContributorAutoConfiguration}.
* *
* @author Dmytro Nosan * @author Dmytro Nosan
*/ */
class HazelcastHealthIndicatorAutoConfigurationTests { class HazelcastHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(HazelcastAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(HazelcastAutoConfiguration.class,
HazelcastHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, HazelcastHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -20,8 +20,6 @@ import org.influxdb.InfluxDB;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.influx.InfluxDbHealthIndicator; import org.springframework.boot.actuate.influx.InfluxDbHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -31,17 +29,15 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link InfluxDbHealthIndicatorAutoConfiguration}. * Tests for {@link InfluxDbHealthContributorAutoConfiguration}.
* *
* @author Eddú Meléndez * @author Eddú Meléndez
*/ */
class InfluxDbHealthIndicatorAutoConfigurationTests { class InfluxDbHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(InfluxDB.class, () -> mock(InfluxDB.class)) .withBean(InfluxDB.class, () -> mock(InfluxDB.class)).withConfiguration(AutoConfigurations
.withConfiguration(AutoConfigurations.of(InfluxDbHealthIndicatorAutoConfiguration.class, .of(InfluxDbHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthIndicatorAutoConfiguration.class, HealthContributorAutoConfiguration.class,
HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -30,8 +30,6 @@ import org.springframework.boot.actuate.audit.InMemoryAuditEventRepository;
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceAutoConfiguration;
import org.springframework.boot.actuate.trace.http.InMemoryHttpTraceRepository; import org.springframework.boot.actuate.trace.http.InMemoryHttpTraceRepository;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -53,8 +51,7 @@ class JmxEndpointIntegrationTests {
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner() private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(JmxAutoConfiguration.class, EndpointAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(JmxAutoConfiguration.class, EndpointAutoConfiguration.class,
JmxEndpointAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, JmxEndpointAutoConfiguration.class, HealthContributorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class,
HttpTraceAutoConfiguration.class)) HttpTraceAutoConfiguration.class))
.withUserConfiguration(HttpTraceRepositoryConfiguration.class, AuditEventRepositoryConfiguration.class) .withUserConfiguration(HttpTraceRepositoryConfiguration.class, AuditEventRepositoryConfiguration.class)
.withPropertyValues("spring.jmx.enabled=true") .withPropertyValues("spring.jmx.enabled=true")

@ -30,8 +30,6 @@ import org.springframework.boot.actuate.audit.InMemoryAuditEventRepository;
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.servlet.ServletManagementContextAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.web.servlet.ServletManagementContextAutoConfiguration;
@ -75,8 +73,7 @@ class WebMvcEndpointExposureIntegrationTests {
EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class, EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class,
ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class, ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class,
ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class, ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class,
HttpTraceAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, HttpTraceAutoConfiguration.class, HealthContributorAutoConfiguration.class))
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class))
.withConfiguration(AutoConfigurations.of(EndpointAutoConfigurationClasses.ALL)) .withConfiguration(AutoConfigurations.of(EndpointAutoConfigurationClasses.ALL))
.withUserConfiguration(CustomMvcEndpoint.class, CustomServletEndpoint.class, .withUserConfiguration(CustomMvcEndpoint.class, CustomServletEndpoint.class,
HttpTraceRepositoryConfiguration.class, AuditEventRepositoryConfiguration.class) HttpTraceRepositoryConfiguration.class, AuditEventRepositoryConfiguration.class)

@ -21,11 +21,10 @@ import javax.sql.DataSource;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.health.CompositeHealthIndicator; import org.springframework.boot.actuate.health.CompositeHealthContributor;
import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.actuate.health.NamedContributor;
import org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator; import org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@ -43,16 +42,15 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link DataSourceHealthIndicatorAutoConfiguration}. * Tests for {@link DataSourceHealthContributorAutoConfiguration}.
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
class DataSourceHealthIndicatorAutoConfigurationTests { class DataSourceHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class, HealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class, DataSourceHealthContributorAutoConfiguration.class))
HealthEndpointAutoConfiguration.class, DataSourceHealthIndicatorAutoConfiguration.class))
.withPropertyValues("spring.datasource.initialization-mode=never"); .withPropertyValues("spring.datasource.initialization-mode=never");
@Test @Test
@ -68,9 +66,10 @@ class DataSourceHealthIndicatorAutoConfigurationTests {
void runWhenMultipleDataSourceBeansShouldCreateCompositeIndicator() { void runWhenMultipleDataSourceBeansShouldCreateCompositeIndicator() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class, DataSourceConfig.class) this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class, DataSourceConfig.class)
.run((context) -> { .run((context) -> {
assertThat(context).hasSingleBean(HealthIndicator.class); assertThat(context).hasSingleBean(CompositeHealthContributor.class);
HealthIndicator indicator = context.getBean(CompositeHealthIndicator.class); CompositeHealthContributor contributor = context.getBean(CompositeHealthContributor.class);
assertThat(indicator.health().getDetails()).containsOnlyKeys("dataSource", "testDataSource"); String[] names = contributor.stream().map(NamedContributor::getName).toArray(String[]::new);
assertThat(names).containsExactlyInAnyOrder("dataSource", "testDataSource");
}); });
} }
@ -78,7 +77,7 @@ class DataSourceHealthIndicatorAutoConfigurationTests {
void runShouldFilterRoutingDataSource() { void runShouldFilterRoutingDataSource() {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class, RoutingDatasourceConfig.class) this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class, RoutingDatasourceConfig.class)
.run((context) -> assertThat(context).hasSingleBean(DataSourceHealthIndicator.class) .run((context) -> assertThat(context).hasSingleBean(DataSourceHealthIndicator.class)
.doesNotHaveBean(CompositeHealthIndicator.class)); .doesNotHaveBean(CompositeHealthContributor.class));
} }
@Test @Test
@ -97,7 +96,7 @@ class DataSourceHealthIndicatorAutoConfigurationTests {
this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class)
.withPropertyValues("management.health.db.enabled:false") .withPropertyValues("management.health.db.enabled:false")
.run((context) -> assertThat(context).doesNotHaveBean(DataSourceHealthIndicator.class) .run((context) -> assertThat(context).doesNotHaveBean(DataSourceHealthIndicator.class)
.doesNotHaveBean(CompositeHealthIndicator.class) .doesNotHaveBean(CompositeHealthContributor.class)
.hasSingleBean(ApplicationHealthIndicator.class)); .hasSingleBean(ApplicationHealthIndicator.class));
} }

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.jms;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.jms.JmsHealthIndicator; import org.springframework.boot.actuate.jms.JmsHealthIndicator;
import org.springframework.boot.actuate.ldap.LdapHealthIndicator; import org.springframework.boot.actuate.ldap.LdapHealthIndicator;
@ -31,16 +29,15 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link JmsHealthIndicatorAutoConfiguration}. * Tests for {@link JmsHealthContributorAutoConfiguration}.
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
class JmsHealthIndicatorAutoConfigurationTests { class JmsHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ActiveMQAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(ActiveMQAutoConfiguration.class,
JmsHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, JmsHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.ldap;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.ldap.LdapHealthIndicator; import org.springframework.boot.actuate.ldap.LdapHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -31,18 +29,16 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link LdapHealthIndicatorAutoConfiguration}. * Tests for {@link LdapHealthContributorAutoConfiguration}.
* *
* @author Eddú Meléndez * @author Eddú Meléndez
* @author Stephane Nicoll * @author Stephane Nicoll
*/ */
class LdapHealthIndicatorAutoConfigurationTests { class LdapHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(LdapOperations.class, () -> mock(LdapOperations.class)) .withBean(LdapOperations.class, () -> mock(LdapOperations.class)).withConfiguration(AutoConfigurations
.withConfiguration(AutoConfigurations.of(LdapHealthIndicatorAutoConfiguration.class, .of(LdapHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthIndicatorAutoConfiguration.class, HealthContributorAutoConfiguration.class,
HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.mail;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.mail.MailHealthIndicator; import org.springframework.boot.actuate.mail.MailHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -30,16 +28,15 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link MailHealthIndicatorAutoConfiguration}. * Tests for {@link MailHealthContributorAutoConfiguration}.
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
class MailHealthIndicatorAutoConfigurationTests { class MailHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(MailSenderAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(MailSenderAutoConfiguration.class,
MailHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, MailHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class))
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class))
.withPropertyValues("spring.mail.host:smtp.example.com"); .withPropertyValues("spring.mail.host:smtp.example.com");
@Test @Test

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.mongo;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.mongo.MongoHealthIndicator; import org.springframework.boot.actuate.mongo.MongoHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -31,16 +29,15 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link MongoHealthIndicatorAutoConfiguration} * Tests for {@link MongoHealthContributorAutoConfiguration}
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
class MongoHealthIndicatorAutoConfigurationTests { class MongoHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class,
MongoHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, MongoHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.mongo;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.mongo.MongoHealthIndicator; import org.springframework.boot.actuate.mongo.MongoHealthIndicator;
import org.springframework.boot.actuate.mongo.MongoReactiveHealthIndicator; import org.springframework.boot.actuate.mongo.MongoReactiveHealthIndicator;
@ -34,17 +32,16 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link MongoReactiveHealthIndicatorAutoConfiguration}. * Tests for {@link MongoReactiveHealthContributorAutoConfiguration}.
* *
* @author Yulin Qin * @author Yulin Qin
*/ */
class MongoReactiveHealthIndicatorAutoConfigurationTests { class MongoReactiveHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class,
MongoReactiveAutoConfiguration.class, MongoReactiveDataAutoConfiguration.class, MongoReactiveAutoConfiguration.class, MongoReactiveDataAutoConfiguration.class,
MongoReactiveHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, MongoReactiveHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -21,8 +21,6 @@ import org.neo4j.ogm.session.Session;
import org.neo4j.ogm.session.SessionFactory; import org.neo4j.ogm.session.SessionFactory;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.neo4j.Neo4jHealthIndicator; import org.springframework.boot.actuate.neo4j.Neo4jHealthIndicator;
@ -36,18 +34,16 @@ import static org.assertj.core.api.Assertions.entry;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link Neo4jHealthIndicatorAutoConfiguration}. * Tests for {@link Neo4jHealthContributorAutoConfiguration}.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Stephane Nicoll * @author Stephane Nicoll
*/ */
class Neo4jHealthIndicatorAutoConfigurationTests { class Neo4jHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withUserConfiguration(Neo4jConfiguration.class) .withUserConfiguration(Neo4jConfiguration.class).withConfiguration(AutoConfigurations
.withConfiguration(AutoConfigurations.of(Neo4jHealthIndicatorAutoConfiguration.class, .of(Neo4jHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthIndicatorAutoConfiguration.class, HealthContributorAutoConfiguration.class,
HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.redis;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.redis.RedisHealthIndicator; import org.springframework.boot.actuate.redis.RedisHealthIndicator;
import org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator; import org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator;
@ -32,17 +30,16 @@ import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link RedisHealthIndicatorAutoConfiguration}. * Tests for {@link RedisHealthContributorAutoConfiguration}.
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
@ClassPathExclusions({ "reactor-core*.jar", "lettuce-core*.jar" }) @ClassPathExclusions({ "reactor-core*.jar", "lettuce-core*.jar" })
class RedisHealthIndicatorAutoConfigurationTests { class RedisHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class,
RedisHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, RedisHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.redis;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.redis.RedisHealthIndicator; import org.springframework.boot.actuate.redis.RedisHealthIndicator;
import org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator; import org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator;
@ -31,21 +29,20 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link RedisReactiveHealthIndicatorAutoConfiguration}. * Tests for {@link RedisReactiveHealthContributorAutoConfiguration}.
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
class RedisReactiveHealthIndicatorAutoConfigurationTests { class RedisReactiveHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class,
RedisReactiveHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, RedisReactiveHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {
this.contextRunner this.contextRunner.run(
.run((context) -> assertThat(context).hasSingleBean(RedisReactiveHealthIndicatorAutoConfiguration.class) (context) -> assertThat(context).hasSingleBean(RedisReactiveHealthContributorAutoConfiguration.class)
.doesNotHaveBean(RedisHealthIndicator.class).doesNotHaveBean(ApplicationHealthIndicator.class)); .doesNotHaveBean(RedisHealthIndicator.class).doesNotHaveBean(ApplicationHealthIndicator.class));
} }

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.solr;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.solr.SolrHealthIndicator; import org.springframework.boot.actuate.solr.SolrHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -30,16 +28,15 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link SolrHealthIndicatorAutoConfiguration}. * Tests for {@link SolrHealthContributorAutoConfiguration}.
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
class SolrHealthIndicatorAutoConfigurationTests { class SolrHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner() private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(SolrAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(SolrAutoConfiguration.class,
SolrHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, SolrHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.system;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.health.ApplicationHealthIndicator; import org.springframework.boot.actuate.health.ApplicationHealthIndicator;
import org.springframework.boot.actuate.system.DiskSpaceHealthIndicator; import org.springframework.boot.actuate.system.DiskSpaceHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -30,16 +28,15 @@ import org.springframework.util.unit.DataSize;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link DiskSpaceHealthIndicatorAutoConfiguration}. * Tests for {@link DiskSpaceHealthContributorAutoConfiguration}.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Stephane Nicoll * @author Stephane Nicoll
*/ */
class DiskSpaceHealthIndicatorAutoConfigurationTests { class DiskSpaceHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(AutoConfigurations private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(AutoConfigurations
.of(DiskSpaceHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class, .of(DiskSpaceHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
@Test @Test
void runShouldCreateIndicator() { void runShouldCreateIndicator() {
Loading…
Cancel
Save