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

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

@ -20,11 +20,11 @@ import java.util.Map;
import com.datastax.driver.core.Cluster;
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.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
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.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -48,16 +48,16 @@ import org.springframework.data.cassandra.core.ReactiveCassandraOperations;
@ConditionalOnClass({ Cluster.class, ReactiveCassandraOperations.class, Flux.class })
@ConditionalOnBean(ReactiveCassandraOperations.class)
@ConditionalOnEnabledHealthIndicator("cassandra")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class)
@AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter(CassandraReactiveDataAutoConfiguration.class)
public class CassandraReactiveHealthIndicatorAutoConfiguration extends
CompositeReactiveHealthIndicatorConfiguration<CassandraReactiveHealthIndicator, ReactiveCassandraOperations> {
public class CassandraReactiveHealthContributorAutoConfiguration extends
CompositeReactiveHealthContributorConfiguration<CassandraReactiveHealthIndicator, ReactiveCassandraOperations> {
@Bean
@ConditionalOnMissingBean(name = "cassandraHealthIndicator")
public ReactiveHealthIndicator cassandraHealthIndicator(
@ConditionalOnMissingBean(name = { "cassandraReactiveHealthIndicator", "cassandraReactiveHealthContributor" })
public ReactiveHealthContributor cassandraReactiveHealthContributor(
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 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.HealthIndicatorAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
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.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@ -47,20 +47,15 @@ import org.springframework.context.annotation.Configuration;
@ConditionalOnClass(Cluster.class)
@ConditionalOnBean(Cluster.class)
@ConditionalOnEnabledHealthIndicator("couchbase")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class)
@AutoConfigureAfter(CouchbaseAutoConfiguration.class)
public class CouchbaseHealthIndicatorAutoConfiguration
extends CompositeHealthIndicatorConfiguration<CouchbaseHealthIndicator, Cluster> {
@AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@AutoConfigureAfter({ CouchbaseAutoConfiguration.class })
public class CouchbaseHealthContributorAutoConfiguration
extends CompositeHealthContributorConfiguration<CouchbaseHealthIndicator, Cluster> {
@Bean
@ConditionalOnMissingBean(name = "couchbaseHealthIndicator")
public HealthIndicator couchbaseHealthIndicator(Map<String, Cluster> clusters) {
return createHealthIndicator(clusters);
}
@Override
protected CouchbaseHealthIndicator createHealthIndicator(Cluster cluster) {
return new CouchbaseHealthIndicator(cluster);
@ConditionalOnMissingBean(name = { "couchbaseHealthContributor", "couchbaseHealthContributor" })
public HealthContributor couchbaseHealthContributor(Map<String, Cluster> clusters) {
return createContributor(clusters);
}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -17,11 +17,12 @@
package org.springframework.boot.actuate.autoconfigure.system;
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.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
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.Configuration;
@ -35,8 +36,9 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnEnabledHealthIndicator("diskspace")
@AutoConfigureBefore(HealthIndicatorAutoConfiguration.class)
public class DiskSpaceHealthIndicatorAutoConfiguration {
@AutoConfigureBefore(HealthContributorAutoConfiguration.class)
@EnableConfigurationProperties(DiskSpaceHealthIndicatorProperties.class)
public class DiskSpaceHealthContributorAutoConfiguration {
@Bean
@ConditionalOnMissingBean(name = "diskSpaceHealthIndicator")
@ -44,9 +46,4 @@ public class DiskSpaceHealthIndicatorAutoConfiguration {
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.actuate.autoconfigure.amqp.RabbitHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.amqp.RabbitHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.audit.AuditAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.cache.CachesEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.cassandra.CassandraHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.cassandra.CassandraReactiveHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.cassandra.CassandraHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.cassandra.CassandraReactiveHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.cloudfoundry.servlet.CloudFoundryActuatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.cloudfoundry.reactive.ReactiveCloudFoundryActuatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.context.properties.ConfigurationPropertiesReportEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.context.ShutdownEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.couchbase.CouchbaseHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.couchbase.CouchbaseReactiveHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchClientHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchJestHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.couchbase.CouchbaseHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.couchbase.CouchbaseReactiveHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchClientHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchJestHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration,\
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.health.HealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.influx.InfluxDbHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.influx.InfluxDbHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.info.InfoContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.integration.IntegrationGraphEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.jms.JmsHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.jms.JmsHealthContributorAutoConfiguration,\
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.logging.LogFileWebEndpointAutoConfiguration,\
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.ThreadDumpEndpointAutoConfiguration,\
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.servlet.WebMvcMetricsAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.metrics.web.tomcat.TomcatMetricsAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.mongo.MongoHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.mongo.MongoReactiveHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.neo4j.Neo4jHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.redis.RedisHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.redis.RedisReactiveHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.mongo.MongoHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.mongo.MongoReactiveHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.neo4j.Neo4jHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.redis.RedisHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.redis.RedisReactiveHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.security.reactive.ReactiveManagementWebSecurityAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.session.SessionsEndpointAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.solr.SolrHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthIndicatorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.solr.SolrHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthContributorAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceAutoConfiguration,\
org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceEndpointAutoConfiguration,\
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.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.autoconfigure.AutoConfigurations;
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;
/**
* Tests for {@link RabbitHealthIndicatorAutoConfiguration}.
* Tests for {@link RabbitHealthContributorAutoConfiguration}.
*
* @author Phillip Webb
*/
class RabbitHealthIndicatorAutoConfigurationTests {
class RabbitHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RabbitAutoConfiguration.class,
RabbitHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
RabbitHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {

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

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.cassandra;
import org.junit.jupiter.api.Test;
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.CassandraReactiveHealthIndicator;
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;
/**
* Tests for {@link CassandraReactiveHealthIndicatorAutoConfiguration}.
* Tests for {@link CassandraReactiveHealthContributorAutoConfiguration}.
*
* @author Artsiom Yudovin
* @author Stephane Nicoll
*/
class CassandraReactiveHealthIndicatorAutoConfigurationTests {
class CassandraReactiveHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(ReactiveCassandraOperations.class, () -> mock(ReactiveCassandraOperations.class))
.withConfiguration(AutoConfigurations.of(CassandraReactiveHealthIndicatorAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class, HealthContributorAutoConfiguration.class,
HealthEndpointAutoConfiguration.class));
.withConfiguration(AutoConfigurations.of(CassandraReactiveHealthContributorAutoConfiguration.class,
HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {

@ -19,8 +19,6 @@ import com.couchbase.client.java.Cluster;
import org.junit.jupiter.api.Test;
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.CouchbaseReactiveHealthIndicator;
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;
/**
* Tests for {@link CouchbaseHealthIndicatorAutoConfiguration}.
* Tests for {@link CouchbaseHealthContributorAutoConfiguration}.
*
* @author Phillip Webb
* @author Stephane Nicoll
*/
class CouchbaseHealthIndicatorAutoConfigurationTests {
class CouchbaseHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(Cluster.class, () -> mock(Cluster.class))
.withConfiguration(AutoConfigurations.of(CouchbaseHealthIndicatorAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class, HealthContributorAutoConfiguration.class,
HealthEndpointAutoConfiguration.class));
.withBean(Cluster.class, () -> mock(Cluster.class)).withConfiguration(AutoConfigurations
.of(CouchbaseHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {

@ -13,14 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.couchbase;
import com.couchbase.client.java.Cluster;
import org.junit.jupiter.api.Test;
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.CouchbaseReactiveHealthIndicator;
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;
/**
* Tests for {@link CouchbaseReactiveHealthIndicatorAutoConfiguration}.
* Tests for {@link CouchbaseReactiveHealthContributorAutoConfiguration}.
*
* @author Mikalai Lushchytski
*/
class CouchbaseReactiveHealthIndicatorAutoConfigurationTests {
class CouchbaseReactiveHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(Cluster.class, () -> mock(Cluster.class))
.withConfiguration(AutoConfigurations.of(CouchbaseReactiveHealthIndicatorAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class, HealthContributorAutoConfiguration.class,
HealthEndpointAutoConfiguration.class));
.withConfiguration(AutoConfigurations.of(CouchbaseReactiveHealthContributorAutoConfiguration.class,
HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {

@ -20,8 +20,6 @@ import io.searchbox.client.JestClient;
import org.junit.jupiter.api.Test;
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.ElasticsearchJestHealthIndicator;
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;
/**
* Tests for {@link ElasticSearchClientHealthIndicatorAutoConfiguration} and
* {@link ElasticSearchJestHealthIndicatorAutoConfiguration}.
* Tests for {@link ElasticSearchClientHealthContributorAutoConfiguration} and
* {@link ElasticSearchJestHealthContributorAutoConfiguration}.
*
* @author Phillip Webb
*/
@Deprecated
class ElasticsearchHealthIndicatorAutoConfigurationTests {
class ElasticsearchHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(AutoConfigurations
.of(ElasticsearchAutoConfiguration.class, ElasticSearchClientHealthIndicatorAutoConfiguration.class,
ElasticSearchJestHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
.of(ElasticsearchAutoConfiguration.class, ElasticSearchClientHealthContributorAutoConfiguration.class,
ElasticSearchJestHealthContributorAutoConfiguration.class,
HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {

@ -20,8 +20,6 @@ import com.hazelcast.core.HazelcastInstance;
import org.junit.jupiter.api.Test;
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.health.Health;
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;
/**
* Integration tests for {@link HazelcastHealthIndicatorAutoConfiguration}.
* Integration tests for {@link HazelcastHealthContributorAutoConfiguration}.
*
* @author Dmytro Nosan
*/
class HazelcastHealthIndicatorAutoConfigurationIntegrationTests {
class HazelcastHealthContributorAutoConfigurationIntegrationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(HazelcastHealthIndicatorAutoConfiguration.class,
HazelcastAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
.withConfiguration(AutoConfigurations.of(HazelcastHealthContributorAutoConfiguration.class,
HazelcastAutoConfiguration.class, HealthContributorAutoConfiguration.class));
@Test
void hazelcastUp() {

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.hazelcast;
import org.junit.jupiter.api.Test;
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.health.ApplicationHealthIndicator;
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;
/**
* Tests for {@link HazelcastHealthIndicatorAutoConfiguration}.
* Tests for {@link HazelcastHealthContributorAutoConfiguration}.
*
* @author Dmytro Nosan
*/
class HazelcastHealthIndicatorAutoConfigurationTests {
class HazelcastHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(HazelcastAutoConfiguration.class,
HazelcastHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
HazelcastHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {

@ -20,8 +20,6 @@ import org.influxdb.InfluxDB;
import org.junit.jupiter.api.Test;
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.influx.InfluxDbHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -31,17 +29,15 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
/**
* Tests for {@link InfluxDbHealthIndicatorAutoConfiguration}.
* Tests for {@link InfluxDbHealthContributorAutoConfiguration}.
*
* @author Eddú Meléndez
*/
class InfluxDbHealthIndicatorAutoConfigurationTests {
class InfluxDbHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withBean(InfluxDB.class, () -> mock(InfluxDB.class))
.withConfiguration(AutoConfigurations.of(InfluxDbHealthIndicatorAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class, HealthContributorAutoConfiguration.class,
HealthEndpointAutoConfiguration.class));
.withBean(InfluxDB.class, () -> mock(InfluxDB.class)).withConfiguration(AutoConfigurations
.of(InfluxDbHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
@Test
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.jmx.JmxEndpointAutoConfiguration;
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.trace.http.InMemoryHttpTraceRepository;
import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -53,8 +51,7 @@ class JmxEndpointIntegrationTests {
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(JmxAutoConfiguration.class, EndpointAutoConfiguration.class,
JmxEndpointAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class,
JmxEndpointAutoConfiguration.class, HealthContributorAutoConfiguration.class,
HttpTraceAutoConfiguration.class))
.withUserConfiguration(HttpTraceRepositoryConfiguration.class, AuditEventRepositoryConfiguration.class)
.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.web.WebEndpointAutoConfiguration;
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.web.server.ManagementContextAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.web.servlet.ServletManagementContextAutoConfiguration;
@ -75,8 +73,7 @@ class WebMvcEndpointExposureIntegrationTests {
EndpointAutoConfiguration.class, WebEndpointAutoConfiguration.class,
ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class,
ManagementContextAutoConfiguration.class, ServletManagementContextAutoConfiguration.class,
HttpTraceAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class))
HttpTraceAutoConfiguration.class, HealthContributorAutoConfiguration.class))
.withConfiguration(AutoConfigurations.of(EndpointAutoConfigurationClasses.ALL))
.withUserConfiguration(CustomMvcEndpoint.class, CustomServletEndpoint.class,
HttpTraceRepositoryConfiguration.class, AuditEventRepositoryConfiguration.class)

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

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.jms;
import org.junit.jupiter.api.Test;
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.jms.JmsHealthIndicator;
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;
/**
* Tests for {@link JmsHealthIndicatorAutoConfiguration}.
* Tests for {@link JmsHealthContributorAutoConfiguration}.
*
* @author Phillip Webb
*/
class JmsHealthIndicatorAutoConfigurationTests {
class JmsHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ActiveMQAutoConfiguration.class,
JmsHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
JmsHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {

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

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.mail;
import org.junit.jupiter.api.Test;
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.mail.MailHealthIndicator;
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;
/**
* Tests for {@link MailHealthIndicatorAutoConfiguration}.
* Tests for {@link MailHealthContributorAutoConfiguration}.
*
* @author Phillip Webb
*/
class MailHealthIndicatorAutoConfigurationTests {
class MailHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(MailSenderAutoConfiguration.class,
MailHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class))
MailHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class))
.withPropertyValues("spring.mail.host:smtp.example.com");
@Test

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.mongo;
import org.junit.jupiter.api.Test;
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.mongo.MongoHealthIndicator;
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;
/**
* Tests for {@link MongoHealthIndicatorAutoConfiguration}
* Tests for {@link MongoHealthContributorAutoConfiguration}
*
* @author Phillip Webb
*/
class MongoHealthIndicatorAutoConfigurationTests {
class MongoHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class,
MongoHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
MongoHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.mongo;
import org.junit.jupiter.api.Test;
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.mongo.MongoHealthIndicator;
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;
/**
* Tests for {@link MongoReactiveHealthIndicatorAutoConfiguration}.
* Tests for {@link MongoReactiveHealthContributorAutoConfiguration}.
*
* @author Yulin Qin
*/
class MongoReactiveHealthIndicatorAutoConfigurationTests {
class MongoReactiveHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class,
MongoReactiveAutoConfiguration.class, MongoReactiveDataAutoConfiguration.class,
MongoReactiveHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
MongoReactiveHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {

@ -21,8 +21,6 @@ import org.neo4j.ogm.session.Session;
import org.neo4j.ogm.session.SessionFactory;
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.Health;
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;
/**
* Tests for {@link Neo4jHealthIndicatorAutoConfiguration}.
* Tests for {@link Neo4jHealthContributorAutoConfiguration}.
*
* @author Phillip Webb
* @author Stephane Nicoll
*/
class Neo4jHealthIndicatorAutoConfigurationTests {
class Neo4jHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withUserConfiguration(Neo4jConfiguration.class)
.withConfiguration(AutoConfigurations.of(Neo4jHealthIndicatorAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class, HealthContributorAutoConfiguration.class,
HealthEndpointAutoConfiguration.class));
.withUserConfiguration(Neo4jConfiguration.class).withConfiguration(AutoConfigurations
.of(Neo4jHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.redis;
import org.junit.jupiter.api.Test;
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.redis.RedisHealthIndicator;
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;
/**
* Tests for {@link RedisHealthIndicatorAutoConfiguration}.
* Tests for {@link RedisHealthContributorAutoConfiguration}.
*
* @author Phillip Webb
*/
@ClassPathExclusions({ "reactor-core*.jar", "lettuce-core*.jar" })
class RedisHealthIndicatorAutoConfigurationTests {
class RedisHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class,
RedisHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
RedisHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {

@ -19,8 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.redis;
import org.junit.jupiter.api.Test;
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.redis.RedisHealthIndicator;
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;
/**
* Tests for {@link RedisReactiveHealthIndicatorAutoConfiguration}.
* Tests for {@link RedisReactiveHealthContributorAutoConfiguration}.
*
* @author Phillip Webb
*/
class RedisReactiveHealthIndicatorAutoConfigurationTests {
class RedisReactiveHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class,
RedisReactiveHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
RedisReactiveHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {
this.contextRunner
.run((context) -> assertThat(context).hasSingleBean(RedisReactiveHealthIndicatorAutoConfiguration.class)
this.contextRunner.run(
(context) -> assertThat(context).hasSingleBean(RedisReactiveHealthContributorAutoConfiguration.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.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.solr.SolrHealthIndicator;
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;
/**
* Tests for {@link SolrHealthIndicatorAutoConfiguration}.
* Tests for {@link SolrHealthContributorAutoConfiguration}.
*
* @author Phillip Webb
*/
class SolrHealthIndicatorAutoConfigurationTests {
class SolrHealthContributorAutoConfigurationTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(SolrAutoConfiguration.class,
SolrHealthIndicatorAutoConfiguration.class, HealthIndicatorAutoConfiguration.class,
HealthContributorAutoConfiguration.class, HealthEndpointAutoConfiguration.class));
SolrHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class));
@Test
void runShouldCreateIndicator() {

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