Move health.* properties to management.health.*

Fixes gh-1841
This commit is contained in:
Stephane Nicoll
2014-11-07 07:19:22 +00:00
parent 27cbf45dbe
commit 00961611b2
7 changed files with 72 additions and 29 deletions

View File

@@ -95,7 +95,7 @@ public class HealthIndicatorAutoConfiguration {
@Configuration
@ConditionalOnBean(DataSource.class)
@ConditionalOnProperty(prefix = "health.db", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.health.db", name = "enabled", matchIfMissing = true)
public static class DataSourcesHealthIndicatorConfiguration {
@Autowired
@@ -142,7 +142,7 @@ public class HealthIndicatorAutoConfiguration {
@Configuration
@ConditionalOnBean(MongoTemplate.class)
@ConditionalOnProperty(prefix = "health.mongo", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.health.mongo", name = "enabled", matchIfMissing = true)
public static class MongoHealthIndicatorConfiguration {
@Autowired
@@ -171,7 +171,7 @@ public class HealthIndicatorAutoConfiguration {
@Configuration
@ConditionalOnBean(RedisConnectionFactory.class)
@ConditionalOnProperty(prefix = "health.redis", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.health.redis", name = "enabled", matchIfMissing = true)
public static class RedisHealthIndicatorConfiguration {
@Autowired
@@ -201,7 +201,7 @@ public class HealthIndicatorAutoConfiguration {
@Configuration
@ConditionalOnBean(RabbitTemplate.class)
@ConditionalOnProperty(prefix = "health.rabbit", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.health.rabbit", name = "enabled", matchIfMissing = true)
public static class RabbitHealthIndicatorConfiguration {
@Autowired
@@ -231,7 +231,7 @@ public class HealthIndicatorAutoConfiguration {
@Configuration
@ConditionalOnBean(SolrServer.class)
@ConditionalOnProperty(prefix = "health.solr", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.health.solr", name = "enabled", matchIfMissing = true)
public static class SolrHealthIndicatorConfiguration {
@Autowired
@@ -259,7 +259,7 @@ public class HealthIndicatorAutoConfiguration {
}
@Configuration
@ConditionalOnProperty(prefix = "health.diskspace", name = "enabled", matchIfMissing = true)
@ConditionalOnProperty(prefix = "management.health.diskspace", name = "enabled", matchIfMissing = true)
public static class DiskSpaceHealthIndicatorConfiguration {
@Bean

View File

@@ -26,7 +26,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @author Christian Dupuis
* @since 1.2.0
*/
@ConfigurationProperties("health.status")
@ConfigurationProperties("management.health.status")
public class HealthIndicatorAutoConfigurationProperties {
private List<String> order = null;

View File

@@ -27,7 +27,7 @@ import org.springframework.util.Assert;
* @author Andy Wilkinson
* @since 1.2.0
*/
@ConfigurationProperties("health.diskspace")
@ConfigurationProperties("management.health.diskspace")
public class DiskSpaceHealthIndicatorProperties {
private static final int MEGABYTES = 1024 * 1024;

View File

@@ -1,4 +1,40 @@
{"properties": [
{
"name": "management.health.db.enabled",
"dataType": "java.lang.Boolean",
"description": "Enable database health check.",
"defaultValue": true
},
{
"name": "management.health.diskspace.enabled",
"dataType": "java.lang.Boolean",
"description": "Enable disk space health check.",
"defaultValue": true
},
{
"name": "management.health.mongo.enabled",
"dataType": "java.lang.Boolean",
"description": "Enable MongoDB health check.",
"defaultValue": true
},
{
"name": "management.health.rabbit.enabled",
"dataType": "java.lang.Boolean",
"description": "Enable RabbitMQ health check.",
"defaultValue": true
},
{
"name": "management.health.redis.enabled",
"dataType": "java.lang.Boolean",
"description": "Enable Redis health check.",
"defaultValue": true
},
{
"name": "management.health.solr.enabled",
"dataType": "java.lang.Boolean",
"description": "Enable Solr health check.",
"defaultValue": true
},
{
"name": "spring.git.properties",
"dataType": "java.lang.String",

View File

@@ -78,7 +78,7 @@ public class HealthIndicatorAutoConfigurationTests {
this.context = new AnnotationConfigApplicationContext();
this.context.register(HealthIndicatorAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context,
"health.diskspace.enabled:false");
"management.health.diskspace.enabled:false");
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
.getBeansOfType(HealthIndicator.class);
@@ -93,7 +93,7 @@ public class HealthIndicatorAutoConfigurationTests {
this.context.register(RedisAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context,
"health.diskspace.enabled:false");
"management.health.diskspace.enabled:false");
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
.getBeansOfType(HealthIndicator.class);
@@ -107,8 +107,8 @@ public class HealthIndicatorAutoConfigurationTests {
this.context = new AnnotationConfigApplicationContext();
this.context.register(RedisAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context, "health.redis.enabled:false",
"health.diskspace.enabled:false");
EnvironmentTestUtils.addEnvironment(this.context, "management.health.redis.enabled:false",
"management.health.diskspace.enabled:false");
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
.getBeansOfType(HealthIndicator.class);
@@ -123,7 +123,7 @@ public class HealthIndicatorAutoConfigurationTests {
this.context.register(MongoAutoConfiguration.class,
MongoDataAutoConfiguration.class, HealthIndicatorAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context,
"health.diskspace.enabled:false");
"management.health.diskspace.enabled:false");
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
.getBeansOfType(HealthIndicator.class);
@@ -137,8 +137,8 @@ public class HealthIndicatorAutoConfigurationTests {
this.context = new AnnotationConfigApplicationContext();
this.context.register(MongoAutoConfiguration.class,
MongoDataAutoConfiguration.class, HealthIndicatorAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context, "health.mongo.enabled:false",
"health.diskspace.enabled:false");
EnvironmentTestUtils.addEnvironment(this.context, "management.health.mongo.enabled:false",
"management.health.diskspace.enabled:false");
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
.getBeansOfType(HealthIndicator.class);
@@ -165,7 +165,7 @@ public class HealthIndicatorAutoConfigurationTests {
this.context.register(EmbeddedDataSourceConfiguration.class,
HealthIndicatorAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context,
"health.diskspace.enabled:false");
"management.health.diskspace.enabled:false");
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
.getBeansOfType(HealthIndicator.class);
@@ -183,7 +183,7 @@ public class HealthIndicatorAutoConfigurationTests {
HealthIndicatorAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context,
"spring.datasource.validation-query:SELECT from FOOBAR",
"health.diskspace.enabled:false");
"management.health.diskspace.enabled:false");
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
.getBeansOfType(HealthIndicator.class);
@@ -199,8 +199,8 @@ public class HealthIndicatorAutoConfigurationTests {
this.context = new AnnotationConfigApplicationContext();
this.context.register(EmbeddedDataSourceConfiguration.class,
HealthIndicatorAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context, "health.db.enabled:false",
"health.diskspace.enabled:false");
EnvironmentTestUtils.addEnvironment(this.context, "management.health.db.enabled:false",
"management.health.diskspace.enabled:false");
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
.getBeansOfType(HealthIndicator.class);
@@ -215,7 +215,7 @@ public class HealthIndicatorAutoConfigurationTests {
this.context.register(RabbitAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context,
"health.diskspace.enabled:false");
"management.health.diskspace.enabled:false");
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
.getBeansOfType(HealthIndicator.class);
@@ -229,8 +229,8 @@ public class HealthIndicatorAutoConfigurationTests {
this.context = new AnnotationConfigApplicationContext();
this.context.register(RabbitAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context, "health.rabbit.enabled:false",
"health.diskspace.enabled:false");
EnvironmentTestUtils.addEnvironment(this.context, "management.health.rabbit.enabled:false",
"management.health.diskspace.enabled:false");
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
.getBeansOfType(HealthIndicator.class);
@@ -245,7 +245,7 @@ public class HealthIndicatorAutoConfigurationTests {
this.context.register(SolrAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context,
"health.diskspace.enabled:false");
"management.health.diskspace.enabled:false");
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
.getBeansOfType(HealthIndicator.class);
@@ -259,8 +259,8 @@ public class HealthIndicatorAutoConfigurationTests {
this.context = new AnnotationConfigApplicationContext();
this.context.register(SolrAutoConfiguration.class,
HealthIndicatorAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context, "health.solr.enabled:false",
"health.diskspace.enabled:false");
EnvironmentTestUtils.addEnvironment(this.context, "management.health.solr.enabled:false",
"management.health.diskspace.enabled:false");
this.context.refresh();
Map<String, HealthIndicator> beans = this.context
.getBeansOfType(HealthIndicator.class);