Merge branch '1.5.x'
This commit is contained in:
@@ -85,6 +85,18 @@
|
||||
"type": "java.util.Map<java.lang.String,java.lang.Object>",
|
||||
"description": "Arbitrary properties to add to the info endpoint."
|
||||
},
|
||||
{
|
||||
"name": "management.health.cassandra.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Enable cassandra health check.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "management.health.couchbase.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "Enable couchbase health check.",
|
||||
"defaultValue": true
|
||||
},
|
||||
{
|
||||
"name": "management.health.db.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
|
||||
2
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointMvcIntegrationTests.java
Normal file → Executable file
2
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointMvcIntegrationTests.java
Normal file → Executable file
@@ -139,7 +139,7 @@ public class EndpointMvcIntegrationTests {
|
||||
|
||||
@Override
|
||||
public void customize(EndpointHandlerMapping mapping) {
|
||||
mapping.setInterceptors(new Object[] { interceptor() });
|
||||
mapping.setInterceptors(interceptor());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
2
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java
Normal file → Executable file
2
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfigurationTests.java
Normal file → Executable file
@@ -850,7 +850,7 @@ public class EndpointWebMvcAutoConfigurationTests {
|
||||
|
||||
@Override
|
||||
public void customize(EndpointHandlerMapping mapping) {
|
||||
mapping.setInterceptors(new Object[] { interceptor() });
|
||||
mapping.setInterceptors(interceptor());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -457,6 +457,21 @@ public class HealthIndicatorAutoConfigurationTests {
|
||||
.isEqualTo(CassandraHealthIndicator.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void notCassandraHealthIndicator() throws Exception {
|
||||
EnvironmentTestUtils.addEnvironment(this.context,
|
||||
"management.health.diskspace.enabled:false",
|
||||
"management.health.cassandra.enabled:false");
|
||||
this.context.register(CassandraConfiguration.class,
|
||||
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
||||
this.context.refresh();
|
||||
Map<String, HealthIndicator> beans = this.context
|
||||
.getBeansOfType(HealthIndicator.class);
|
||||
assertThat(beans).hasSize(1);
|
||||
assertThat(beans.values().iterator().next().getClass())
|
||||
.isEqualTo(ApplicationHealthIndicator.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void couchbaseHealthIndicator() throws Exception {
|
||||
EnvironmentTestUtils.addEnvironment(this.context,
|
||||
@@ -471,6 +486,21 @@ public class HealthIndicatorAutoConfigurationTests {
|
||||
.isEqualTo(CouchbaseHealthIndicator.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void notCouchbaseHealthIndicator() throws Exception {
|
||||
EnvironmentTestUtils.addEnvironment(this.context,
|
||||
"management.health.diskspace.enabled:false",
|
||||
"management.health.couchbase.enabled:false");
|
||||
this.context.register(CouchbaseConfiguration.class,
|
||||
ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class);
|
||||
this.context.refresh();
|
||||
Map<String, HealthIndicator> beans = this.context
|
||||
.getBeansOfType(HealthIndicator.class);
|
||||
assertThat(beans.size()).isEqualTo(1);
|
||||
assertThat(beans.values().iterator().next().getClass())
|
||||
.isEqualTo(ApplicationHealthIndicator.class);
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableConfigurationProperties
|
||||
protected static class DataSourceConfig {
|
||||
|
||||
@@ -145,7 +145,7 @@ public class MetricFilterAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void recordsHttpInteractionsWithWilcardMapping() throws Exception {
|
||||
public void recordsHttpInteractionsWithWildcardMapping() throws Exception {
|
||||
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
|
||||
Config.class, MetricFilterAutoConfiguration.class);
|
||||
Filter filter = context.getBean(Filter.class);
|
||||
|
||||
@@ -98,7 +98,7 @@ public class HalBrowserMvcEndpointDisabledIntegrationTests {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SpringBootHypermediaApplication.class,
|
||||
new String[] { "--endpoints.hypermedia.enabled=false" });
|
||||
"--endpoints.hypermedia.enabled=false");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user