@@ -76,7 +76,8 @@ public void close() {
7676 @ Test
7777 public void defaultHealthIndicator () {
7878 this .context = new AnnotationConfigApplicationContext ();
79- this .context .register (HealthIndicatorAutoConfiguration .class );
79+ this .context .register (HealthIndicatorAutoConfiguration .class ,
80+ ManagementServerProperties .class );
8081 EnvironmentTestUtils .addEnvironment (this .context ,
8182 "management.health.diskspace.enabled:false" );
8283 this .context .refresh ();
@@ -91,6 +92,7 @@ public void defaultHealthIndicator() {
9192 public void redisHealthIndicator () {
9293 this .context = new AnnotationConfigApplicationContext ();
9394 this .context .register (RedisAutoConfiguration .class ,
95+ ManagementServerProperties .class ,
9496 HealthIndicatorAutoConfiguration .class );
9597 EnvironmentTestUtils .addEnvironment (this .context ,
9698 "management.health.diskspace.enabled:false" );
@@ -106,6 +108,7 @@ public void redisHealthIndicator() {
106108 public void notRedisHealthIndicator () {
107109 this .context = new AnnotationConfigApplicationContext ();
108110 this .context .register (RedisAutoConfiguration .class ,
111+ ManagementServerProperties .class ,
109112 HealthIndicatorAutoConfiguration .class );
110113 EnvironmentTestUtils .addEnvironment (this .context ,
111114 "management.health.redis.enabled:false" ,
@@ -122,6 +125,7 @@ public void notRedisHealthIndicator() {
122125 public void mongoHealthIndicator () {
123126 this .context = new AnnotationConfigApplicationContext ();
124127 this .context .register (MongoAutoConfiguration .class ,
128+ ManagementServerProperties .class ,
125129 MongoDataAutoConfiguration .class , HealthIndicatorAutoConfiguration .class );
126130 EnvironmentTestUtils .addEnvironment (this .context ,
127131 "management.health.diskspace.enabled:false" );
@@ -137,6 +141,7 @@ public void mongoHealthIndicator() {
137141 public void notMongoHealthIndicator () {
138142 this .context = new AnnotationConfigApplicationContext ();
139143 this .context .register (MongoAutoConfiguration .class ,
144+ ManagementServerProperties .class ,
140145 MongoDataAutoConfiguration .class , HealthIndicatorAutoConfiguration .class );
141146 EnvironmentTestUtils .addEnvironment (this .context ,
142147 "management.health.mongo.enabled:false" ,
@@ -165,6 +170,7 @@ public void combinedHealthIndicator() {
165170 public void dataSourceHealthIndicator () {
166171 this .context = new AnnotationConfigApplicationContext ();
167172 this .context .register (EmbeddedDataSourceConfiguration .class ,
173+ ManagementServerProperties .class ,
168174 HealthIndicatorAutoConfiguration .class );
169175 EnvironmentTestUtils .addEnvironment (this .context ,
170176 "management.health.diskspace.enabled:false" );
@@ -180,6 +186,7 @@ public void dataSourceHealthIndicator() {
180186 public void dataSourceHealthIndicatorWithCustomValidationQuery () {
181187 this .context = new AnnotationConfigApplicationContext ();
182188 this .context .register (PropertyPlaceholderAutoConfiguration .class ,
189+ ManagementServerProperties .class ,
183190 DataSourceProperties .class , DataSourceConfig .class ,
184191 DataSourcePoolMetadataProvidersConfiguration .class ,
185192 HealthIndicatorAutoConfiguration .class );
@@ -200,6 +207,7 @@ public void dataSourceHealthIndicatorWithCustomValidationQuery() {
200207 public void notDataSourceHealthIndicator () {
201208 this .context = new AnnotationConfigApplicationContext ();
202209 this .context .register (EmbeddedDataSourceConfiguration .class ,
210+ ManagementServerProperties .class ,
203211 HealthIndicatorAutoConfiguration .class );
204212 EnvironmentTestUtils .addEnvironment (this .context ,
205213 "management.health.db.enabled:false" ,
@@ -216,6 +224,7 @@ public void notDataSourceHealthIndicator() {
216224 public void rabbitHealthIndicator () {
217225 this .context = new AnnotationConfigApplicationContext ();
218226 this .context .register (RabbitAutoConfiguration .class ,
227+ ManagementServerProperties .class ,
219228 HealthIndicatorAutoConfiguration .class );
220229 EnvironmentTestUtils .addEnvironment (this .context ,
221230 "management.health.diskspace.enabled:false" );
@@ -231,6 +240,7 @@ public void rabbitHealthIndicator() {
231240 public void notRabbitHealthIndicator () {
232241 this .context = new AnnotationConfigApplicationContext ();
233242 this .context .register (RabbitAutoConfiguration .class ,
243+ ManagementServerProperties .class ,
234244 HealthIndicatorAutoConfiguration .class );
235245 EnvironmentTestUtils .addEnvironment (this .context ,
236246 "management.health.rabbit.enabled:false" ,
@@ -247,6 +257,7 @@ public void notRabbitHealthIndicator() {
247257 public void solrHeathIndicator () {
248258 this .context = new AnnotationConfigApplicationContext ();
249259 this .context .register (SolrAutoConfiguration .class ,
260+ ManagementServerProperties .class ,
250261 HealthIndicatorAutoConfiguration .class );
251262 EnvironmentTestUtils .addEnvironment (this .context ,
252263 "management.health.diskspace.enabled:false" );
@@ -262,6 +273,7 @@ public void solrHeathIndicator() {
262273 public void notSolrHeathIndicator () {
263274 this .context = new AnnotationConfigApplicationContext ();
264275 this .context .register (SolrAutoConfiguration .class ,
276+ ManagementServerProperties .class ,
265277 HealthIndicatorAutoConfiguration .class );
266278 EnvironmentTestUtils .addEnvironment (this .context ,
267279 "management.health.solr.enabled:false" ,
0 commit comments