@Test public void elasticsearchHealthIndicator() { EnvironmentTestUtils.addEnvironment(this.context, "spring.data.elasticsearch.properties.path.home:target", "management.health.diskspace.enabled:false"); this.context.register(JestClientConfiguration.class, JestAutoConfiguration.class, ElasticsearchAutoConfiguration.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(ElasticsearchHealthIndicator.class); }
@Test public void elasticSearchHealthIndicator() { EnvironmentTestUtils.addEnvironment(this.context, "spring.data.elasticsearch.properties.path.data:target/data", "spring.data.elasticsearch.properties.path.logs:target/logs", "management.health.diskspace.enabled:false"); this.context.register(ElasticsearchAutoConfiguration.class, ManagementServerProperties.class, HealthIndicatorAutoConfiguration.class); this.context.refresh(); Map<String, HealthIndicator> beans = this.context .getBeansOfType(HealthIndicator.class); assertEquals(1, beans.size()); assertEquals(ElasticsearchHealthIndicator.class, beans.values().iterator().next().getClass()); }
@Test public void elasticSearchHealthIndicator() { EnvironmentTestUtils.addEnvironment(this.context, "spring.data.elasticsearch.properties.path.home:target", "management.health.diskspace.enabled:false"); this.context.register(ElasticsearchAutoConfiguration.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(ElasticsearchHealthIndicator.class); }
@Override protected ElasticsearchHealthIndicator createHealthIndicator(Client client) { return new ElasticsearchHealthIndicator(client, this.properties); }