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