|
|
@ -57,7 +57,7 @@ import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration;
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
|
|
import org.springframework.boot.test.util.EnvironmentTestUtils;
|
|
|
|
import org.springframework.boot.test.util.TestPropertyValues;
|
|
|
|
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
|
|
|
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
@ -92,8 +92,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
public void defaultHealthIndicator() {
|
|
|
|
public void defaultHealthIndicator() {
|
|
|
|
this.context.register(HealthIndicatorAutoConfiguration.class,
|
|
|
|
this.context.register(HealthIndicatorAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class);
|
|
|
|
ManagementServerProperties.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -106,8 +106,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
public void defaultHealthIndicatorsDisabled() {
|
|
|
|
public void defaultHealthIndicatorsDisabled() {
|
|
|
|
this.context.register(HealthIndicatorAutoConfiguration.class,
|
|
|
|
this.context.register(HealthIndicatorAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class);
|
|
|
|
ManagementServerProperties.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.defaults.enabled:false");
|
|
|
|
"management.health.defaults.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -120,8 +120,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
public void defaultHealthIndicatorsDisabledWithCustomOne() {
|
|
|
|
public void defaultHealthIndicatorsDisabledWithCustomOne() {
|
|
|
|
this.context.register(CustomHealthIndicator.class,
|
|
|
|
this.context.register(CustomHealthIndicator.class,
|
|
|
|
HealthIndicatorAutoConfiguration.class, ManagementServerProperties.class);
|
|
|
|
HealthIndicatorAutoConfiguration.class, ManagementServerProperties.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.defaults.enabled:false");
|
|
|
|
"management.health.defaults.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -134,9 +134,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
public void defaultHealthIndicatorsDisabledButOne() {
|
|
|
|
public void defaultHealthIndicatorsDisabledButOne() {
|
|
|
|
this.context.register(HealthIndicatorAutoConfiguration.class,
|
|
|
|
this.context.register(HealthIndicatorAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class);
|
|
|
|
ManagementServerProperties.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.defaults.enabled:false",
|
|
|
|
"management.health.defaults.enabled:false",
|
|
|
|
"management.health.diskspace.enabled:true");
|
|
|
|
"management.health.diskspace.enabled:true").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -149,8 +149,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
public void redisHealthIndicator() {
|
|
|
|
public void redisHealthIndicator() {
|
|
|
|
this.context.register(RedisAutoConfiguration.class,
|
|
|
|
this.context.register(RedisAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -163,9 +163,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
public void notRedisHealthIndicator() {
|
|
|
|
public void notRedisHealthIndicator() {
|
|
|
|
this.context.register(RedisAutoConfiguration.class,
|
|
|
|
this.context.register(RedisAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.redis.enabled:false",
|
|
|
|
"management.health.redis.enabled:false",
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -179,8 +179,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
this.context.register(MongoAutoConfiguration.class,
|
|
|
|
this.context.register(MongoAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, MongoDataAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, MongoDataAutoConfiguration.class,
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -194,9 +194,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
this.context.register(MongoAutoConfiguration.class,
|
|
|
|
this.context.register(MongoAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, MongoDataAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, MongoDataAutoConfiguration.class,
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.mongo.enabled:false",
|
|
|
|
"management.health.mongo.enabled:false",
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -220,8 +220,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
public void dataSourceHealthIndicator() {
|
|
|
|
public void dataSourceHealthIndicator() {
|
|
|
|
this.context.register(EmbeddedDataSourceConfiguration.class,
|
|
|
|
this.context.register(EmbeddedDataSourceConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -235,8 +235,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
this.context.register(EmbeddedDataSourceConfiguration.class,
|
|
|
|
this.context.register(EmbeddedDataSourceConfiguration.class,
|
|
|
|
DataSourceConfig.class, ManagementServerProperties.class,
|
|
|
|
DataSourceConfig.class, ManagementServerProperties.class,
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -252,8 +252,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
this.context.register(EmbeddedDataSourceConfiguration.class,
|
|
|
|
this.context.register(EmbeddedDataSourceConfiguration.class,
|
|
|
|
RoutingDatasourceConfig.class, ManagementServerProperties.class,
|
|
|
|
RoutingDatasourceConfig.class, ManagementServerProperties.class,
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -269,9 +269,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
DataSourceConfig.class,
|
|
|
|
DataSourceConfig.class,
|
|
|
|
DataSourcePoolMetadataProvidersConfiguration.class,
|
|
|
|
DataSourcePoolMetadataProvidersConfiguration.class,
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"spring.datasource.test.validation-query:SELECT from FOOBAR",
|
|
|
|
"spring.datasource.test.validation-query:SELECT from FOOBAR",
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -286,9 +286,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
public void notDataSourceHealthIndicator() {
|
|
|
|
public void notDataSourceHealthIndicator() {
|
|
|
|
this.context.register(EmbeddedDataSourceConfiguration.class,
|
|
|
|
this.context.register(EmbeddedDataSourceConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.db.enabled:false",
|
|
|
|
"management.health.db.enabled:false",
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -301,8 +301,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
public void rabbitHealthIndicator() {
|
|
|
|
public void rabbitHealthIndicator() {
|
|
|
|
this.context.register(RabbitAutoConfiguration.class,
|
|
|
|
this.context.register(RabbitAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -315,9 +315,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
public void notRabbitHealthIndicator() {
|
|
|
|
public void notRabbitHealthIndicator() {
|
|
|
|
this.context.register(RabbitAutoConfiguration.class,
|
|
|
|
this.context.register(RabbitAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.rabbit.enabled:false",
|
|
|
|
"management.health.rabbit.enabled:false",
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -330,8 +330,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
public void solrHealthIndicator() {
|
|
|
|
public void solrHealthIndicator() {
|
|
|
|
this.context.register(SolrAutoConfiguration.class,
|
|
|
|
this.context.register(SolrAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -344,9 +344,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
public void notSolrHealthIndicator() {
|
|
|
|
public void notSolrHealthIndicator() {
|
|
|
|
this.context.register(SolrAutoConfiguration.class,
|
|
|
|
this.context.register(SolrAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.solr.enabled:false",
|
|
|
|
"management.health.solr.enabled:false",
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
Map<String, HealthIndicator> beans = this.context
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
|
.getBeansOfType(HealthIndicator.class);
|
|
|
@ -368,9 +368,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void mailHealthIndicator() {
|
|
|
|
public void mailHealthIndicator() {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"spring.mail.host:smtp.acme.org",
|
|
|
|
"spring.mail.host:smtp.acme.org",
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(MailSenderAutoConfiguration.class,
|
|
|
|
this.context.register(MailSenderAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
@ -384,9 +384,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void notMailHealthIndicator() {
|
|
|
|
public void notMailHealthIndicator() {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"spring.mail.host:smtp.acme.org", "management.health.mail.enabled:false",
|
|
|
|
"spring.mail.host:smtp.acme.org", "management.health.mail.enabled:false",
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(MailSenderAutoConfiguration.class,
|
|
|
|
this.context.register(MailSenderAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
@ -400,8 +400,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void jmsHealthIndicator() {
|
|
|
|
public void jmsHealthIndicator() {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(ActiveMQAutoConfiguration.class,
|
|
|
|
this.context.register(ActiveMQAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
@ -415,9 +415,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void notJmsHealthIndicator() {
|
|
|
|
public void notJmsHealthIndicator() {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.jms.enabled:false",
|
|
|
|
"management.health.jms.enabled:false",
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(ActiveMQAutoConfiguration.class,
|
|
|
|
this.context.register(ActiveMQAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
@ -431,9 +431,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void elasticsearchHealthIndicator() {
|
|
|
|
public void elasticsearchHealthIndicator() {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"spring.data.elasticsearch.properties.path.home:target",
|
|
|
|
"spring.data.elasticsearch.properties.path.home:target",
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class,
|
|
|
|
this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class,
|
|
|
|
ElasticsearchAutoConfiguration.class, ManagementServerProperties.class,
|
|
|
|
ElasticsearchAutoConfiguration.class, ManagementServerProperties.class,
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
@ -448,8 +448,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void elasticsearchJestHealthIndicator() {
|
|
|
|
public void elasticsearchJestHealthIndicator() {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class,
|
|
|
|
this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
@ -463,10 +463,10 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void notElasticsearchHealthIndicator() {
|
|
|
|
public void notElasticsearchHealthIndicator() {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.elasticsearch.enabled:false",
|
|
|
|
"management.health.elasticsearch.enabled:false",
|
|
|
|
"spring.data.elasticsearch.properties.path.home:target",
|
|
|
|
"spring.data.elasticsearch.properties.path.home:target",
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class,
|
|
|
|
this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class,
|
|
|
|
ElasticsearchAutoConfiguration.class, ManagementServerProperties.class,
|
|
|
|
ElasticsearchAutoConfiguration.class, ManagementServerProperties.class,
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
@ -481,8 +481,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void cassandraHealthIndicator() throws Exception {
|
|
|
|
public void cassandraHealthIndicator() throws Exception {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(CassandraConfiguration.class,
|
|
|
|
this.context.register(CassandraConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
@ -495,9 +495,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void notCassandraHealthIndicator() throws Exception {
|
|
|
|
public void notCassandraHealthIndicator() throws Exception {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false",
|
|
|
|
"management.health.diskspace.enabled:false",
|
|
|
|
"management.health.cassandra.enabled:false");
|
|
|
|
"management.health.cassandra.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(CassandraConfiguration.class,
|
|
|
|
this.context.register(CassandraConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
@ -510,8 +510,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void couchbaseHealthIndicator() throws Exception {
|
|
|
|
public void couchbaseHealthIndicator() throws Exception {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(CouchbaseConfiguration.class,
|
|
|
|
this.context.register(CouchbaseConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
@ -524,9 +524,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void notCouchbaseHealthIndicator() throws Exception {
|
|
|
|
public void notCouchbaseHealthIndicator() throws Exception {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false",
|
|
|
|
"management.health.diskspace.enabled:false",
|
|
|
|
"management.health.couchbase.enabled:false");
|
|
|
|
"management.health.couchbase.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(CouchbaseConfiguration.class,
|
|
|
|
this.context.register(CouchbaseConfiguration.class,
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
@ -539,8 +539,8 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void ldapHealthIndicator() throws Exception {
|
|
|
|
public void ldapHealthIndicator() throws Exception {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false");
|
|
|
|
"management.health.diskspace.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(LdapConfiguration.class, ManagementServerProperties.class,
|
|
|
|
this.context.register(LdapConfiguration.class, ManagementServerProperties.class,
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
@ -553,9 +553,9 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void notLdapHealthIndicator() throws Exception {
|
|
|
|
public void notLdapHealthIndicator() throws Exception {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
TestPropertyValues.of(
|
|
|
|
"management.health.diskspace.enabled:false",
|
|
|
|
"management.health.diskspace.enabled:false",
|
|
|
|
"management.health.ldap.enabled:false");
|
|
|
|
"management.health.ldap.enabled:false").applyTo(this.context);
|
|
|
|
this.context.register(LdapConfiguration.class, ManagementServerProperties.class,
|
|
|
|
this.context.register(LdapConfiguration.class, ManagementServerProperties.class,
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
HealthIndicatorAutoConfiguration.class);
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|