Review conditions of ElasticsearchHealthIndicatorAutoConfiguration

Closes gh-12249
pull/12272/head
Stephane Nicoll 7 years ago
parent cb96bbd9be
commit b0f381bb6f

@ -32,6 +32,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration;
import org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration;
@ -55,6 +56,7 @@ import org.springframework.context.annotation.Configuration;
public class ElasticsearchHealthIndicatorAutoConfiguration {
@Configuration
@ConditionalOnClass(Client.class)
@ConditionalOnBean(Client.class)
@EnableConfigurationProperties(ElasticsearchHealthIndicatorProperties.class)
static class ElasticsearchClientHealthIndicatorConfiguration extends
@ -87,6 +89,7 @@ public class ElasticsearchHealthIndicatorAutoConfiguration {
}
@Configuration
@ConditionalOnClass(JestClient.class)
@ConditionalOnBean(JestClient.class)
static class ElasticsearchJestHealthIndicatorConfiguration extends
CompositeHealthIndicatorConfiguration<ElasticsearchJestHealthIndicator, JestClient> {

Loading…
Cancel
Save