Skip to content

Commit b0f381b

Browse files
committed
Review conditions of ElasticsearchHealthIndicatorAutoConfiguration
Closes gh-12249
1 parent cb96bbd commit b0f381b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchHealthIndicatorAutoConfiguration.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
3333
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
3434
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
35+
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
3536
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
3637
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchAutoConfiguration;
3738
import org.springframework.boot.autoconfigure.elasticsearch.jest.JestAutoConfiguration;
@@ -55,6 +56,7 @@
5556
public class ElasticsearchHealthIndicatorAutoConfiguration {
5657

5758
@Configuration
59+
@ConditionalOnClass(Client.class)
5860
@ConditionalOnBean(Client.class)
5961
@EnableConfigurationProperties(ElasticsearchHealthIndicatorProperties.class)
6062
static class ElasticsearchClientHealthIndicatorConfiguration extends
@@ -87,6 +89,7 @@ protected ElasticsearchHealthIndicator createHealthIndicator(Client client) {
8789
}
8890

8991
@Configuration
92+
@ConditionalOnClass(JestClient.class)
9093
@ConditionalOnBean(JestClient.class)
9194
static class ElasticsearchJestHealthIndicatorConfiguration extends
9295
CompositeHealthIndicatorConfiguration<ElasticsearchJestHealthIndicator, JestClient> {

0 commit comments

Comments
 (0)