Fix Elasticsearch template condition if no client is defined

This commit makes sure to backoff if a Client bean is not available.

Closes gh-10143
This commit is contained in:
Stephane Nicoll
2017-09-07 10:32:21 +02:00
parent 5fc01880bc
commit db18abc542
2 changed files with 11 additions and 1 deletions

View File

@@ -46,6 +46,14 @@ public class ElasticsearchDataAutoConfigurationTests {
}
}
@Test
public void templateBackOffWithNoClient() {
this.context = new AnnotationConfigApplicationContext(
ElasticsearchDataAutoConfiguration.class);
assertThat(this.context.getBeanNamesForType(ElasticsearchTemplate.class))
.isEmpty();
}
@Test
public void templateExists() {
load("spring.data.elasticsearch.properties.path.data:target/data",