|
|
@ -457,6 +457,21 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
.isEqualTo(CassandraHealthIndicator.class);
|
|
|
|
.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
|
|
|
|
@Test
|
|
|
|
public void couchbaseHealthIndicator() throws Exception {
|
|
|
|
public void couchbaseHealthIndicator() throws Exception {
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
|
EnvironmentTestUtils.addEnvironment(this.context,
|
|
|
@ -471,6 +486,21 @@ public class HealthIndicatorAutoConfigurationTests {
|
|
|
|
.isEqualTo(CouchbaseHealthIndicator.class);
|
|
|
|
.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
|
|
|
|
@Configuration
|
|
|
|
@EnableConfigurationProperties
|
|
|
|
@EnableConfigurationProperties
|
|
|
|
protected static class DataSourceConfig {
|
|
|
|
protected static class DataSourceConfig {
|
|
|
|