@ -76,7 +76,8 @@ public class HealthIndicatorAutoConfigurationTests {
@Test
public void defaultHealthIndicator ( ) {
this . context = new AnnotationConfigApplicationContext ( ) ;
this . context . register ( HealthIndicatorAutoConfiguration . class ) ;
this . context . register ( HealthIndicatorAutoConfiguration . class ,
ManagementServerProperties . class ) ;
EnvironmentTestUtils . addEnvironment ( this . context ,
"management.health.diskspace.enabled:false" ) ;
this . context . refresh ( ) ;
@ -91,6 +92,7 @@ public class HealthIndicatorAutoConfigurationTests {
public void redisHealthIndicator ( ) {
this . context = new AnnotationConfigApplicationContext ( ) ;
this . context . register ( RedisAutoConfiguration . class ,
ManagementServerProperties . class ,
HealthIndicatorAutoConfiguration . class ) ;
EnvironmentTestUtils . addEnvironment ( this . context ,
"management.health.diskspace.enabled:false" ) ;
@ -106,6 +108,7 @@ public class HealthIndicatorAutoConfigurationTests {
public void notRedisHealthIndicator ( ) {
this . context = new AnnotationConfigApplicationContext ( ) ;
this . context . register ( RedisAutoConfiguration . class ,
ManagementServerProperties . class ,
HealthIndicatorAutoConfiguration . class ) ;
EnvironmentTestUtils . addEnvironment ( this . context ,
"management.health.redis.enabled:false" ,
@ -122,6 +125,7 @@ public class HealthIndicatorAutoConfigurationTests {
public void mongoHealthIndicator ( ) {
this . context = new AnnotationConfigApplicationContext ( ) ;
this . context . register ( MongoAutoConfiguration . class ,
ManagementServerProperties . class ,
MongoDataAutoConfiguration . class , HealthIndicatorAutoConfiguration . class ) ;
EnvironmentTestUtils . addEnvironment ( this . context ,
"management.health.diskspace.enabled:false" ) ;
@ -137,6 +141,7 @@ public class HealthIndicatorAutoConfigurationTests {
public void notMongoHealthIndicator ( ) {
this . context = new AnnotationConfigApplicationContext ( ) ;
this . context . register ( MongoAutoConfiguration . class ,
ManagementServerProperties . class ,
MongoDataAutoConfiguration . class , HealthIndicatorAutoConfiguration . class ) ;
EnvironmentTestUtils . addEnvironment ( this . context ,
"management.health.mongo.enabled:false" ,
@ -165,6 +170,7 @@ public class HealthIndicatorAutoConfigurationTests {
public void dataSourceHealthIndicator ( ) {
this . context = new AnnotationConfigApplicationContext ( ) ;
this . context . register ( EmbeddedDataSourceConfiguration . class ,
ManagementServerProperties . class ,
HealthIndicatorAutoConfiguration . class ) ;
EnvironmentTestUtils . addEnvironment ( this . context ,
"management.health.diskspace.enabled:false" ) ;
@ -180,6 +186,7 @@ public class HealthIndicatorAutoConfigurationTests {
public void dataSourceHealthIndicatorWithCustomValidationQuery ( ) {
this . context = new AnnotationConfigApplicationContext ( ) ;
this . context . register ( PropertyPlaceholderAutoConfiguration . class ,
ManagementServerProperties . class ,
DataSourceProperties . class , DataSourceConfig . class ,
DataSourcePoolMetadataProvidersConfiguration . class ,
HealthIndicatorAutoConfiguration . class ) ;
@ -200,6 +207,7 @@ public class HealthIndicatorAutoConfigurationTests {
public void notDataSourceHealthIndicator ( ) {
this . context = new AnnotationConfigApplicationContext ( ) ;
this . context . register ( EmbeddedDataSourceConfiguration . class ,
ManagementServerProperties . class ,
HealthIndicatorAutoConfiguration . class ) ;
EnvironmentTestUtils . addEnvironment ( this . context ,
"management.health.db.enabled:false" ,
@ -216,6 +224,7 @@ public class HealthIndicatorAutoConfigurationTests {
public void rabbitHealthIndicator ( ) {
this . context = new AnnotationConfigApplicationContext ( ) ;
this . context . register ( RabbitAutoConfiguration . class ,
ManagementServerProperties . class ,
HealthIndicatorAutoConfiguration . class ) ;
EnvironmentTestUtils . addEnvironment ( this . context ,
"management.health.diskspace.enabled:false" ) ;
@ -231,6 +240,7 @@ public class HealthIndicatorAutoConfigurationTests {
public void notRabbitHealthIndicator ( ) {
this . context = new AnnotationConfigApplicationContext ( ) ;
this . context . register ( RabbitAutoConfiguration . class ,
ManagementServerProperties . class ,
HealthIndicatorAutoConfiguration . class ) ;
EnvironmentTestUtils . addEnvironment ( this . context ,
"management.health.rabbit.enabled:false" ,
@ -247,6 +257,7 @@ public class HealthIndicatorAutoConfigurationTests {
public void solrHeathIndicator ( ) {
this . context = new AnnotationConfigApplicationContext ( ) ;
this . context . register ( SolrAutoConfiguration . class ,
ManagementServerProperties . class ,
HealthIndicatorAutoConfiguration . class ) ;
EnvironmentTestUtils . addEnvironment ( this . context ,
"management.health.diskspace.enabled:false" ) ;
@ -262,6 +273,7 @@ public class HealthIndicatorAutoConfigurationTests {
public void notSolrHeathIndicator ( ) {
this . context = new AnnotationConfigApplicationContext ( ) ;
this . context . register ( SolrAutoConfiguration . class ,
ManagementServerProperties . class ,
HealthIndicatorAutoConfiguration . class ) ;
EnvironmentTestUtils . addEnvironment ( this . context ,
"management.health.solr.enabled:false" ,