|
|
|
@ -45,6 +45,7 @@ import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
import static org.mockito.Mockito.mock;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tests for {@link ElasticsearchRestClientAutoConfiguration}.
|
|
|
|
@ -69,6 +70,13 @@ class ElasticsearchRestClientAutoConfigurationTests {
|
|
|
|
|
.hasSingleBean(RestHighLevelClient.class));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void configureWhenCustomRestClientShouldBackOff() {
|
|
|
|
|
this.contextRunner.withBean("customRestClient", RestClient.class, () -> mock(RestClient.class))
|
|
|
|
|
.run((context) -> assertThat(context).doesNotHaveBean(RestHighLevelClient.class)
|
|
|
|
|
.hasSingleBean(RestClient.class).hasBean("customRestClient"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void configureWhenCustomRestHighLevelClientShouldBackOff() {
|
|
|
|
|
this.contextRunner.withUserConfiguration(CustomRestHighLevelClientConfiguration.class)
|
|
|
|
|