Move auto-config of ReactiveElasticClient to elasticsearch pkg

Closes gh-28068
pull/31327/head
Andy Wilkinson 2 years ago
parent db847e2a82
commit 91bb5aa222

@ -29,7 +29,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRestClientAutoConfiguration; import org.springframework.boot.autoconfigure.elasticsearch.ReactiveElasticsearchClientAutoConfiguration;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsearchClient; import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsearchClient;
@ -41,7 +41,7 @@ import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsea
* @author Aleksander Lech * @author Aleksander Lech
* @since 2.3.2 * @since 2.3.2
*/ */
@AutoConfiguration(after = ReactiveElasticsearchRestClientAutoConfiguration.class) @AutoConfiguration(after = ReactiveElasticsearchClientAutoConfiguration.class)
@ConditionalOnClass({ ReactiveElasticsearchClient.class, Flux.class }) @ConditionalOnClass({ ReactiveElasticsearchClient.class, Flux.class })
@ConditionalOnBean(ReactiveElasticsearchClient.class) @ConditionalOnBean(ReactiveElasticsearchClient.class)
@ConditionalOnEnabledHealthIndicator("elasticsearch") @ConditionalOnEnabledHealthIndicator("elasticsearch")

@ -23,8 +23,8 @@ import org.springframework.boot.actuate.elasticsearch.ElasticsearchReactiveHealt
import org.springframework.boot.actuate.elasticsearch.ElasticsearchRestClientHealthIndicator; import org.springframework.boot.actuate.elasticsearch.ElasticsearchRestClientHealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration; import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration;
import org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRestClientAutoConfiguration;
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration; import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration;
import org.springframework.boot.autoconfigure.elasticsearch.ReactiveElasticsearchClientAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
@ -38,8 +38,7 @@ class ElasticsearchReactiveHealthContributorAutoConfigurationTests {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ElasticsearchDataAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(ElasticsearchDataAutoConfiguration.class,
ReactiveElasticsearchRestClientAutoConfiguration.class, ReactiveElasticsearchClientAutoConfiguration.class, ElasticsearchRestClientAutoConfiguration.class,
ElasticsearchRestClientAutoConfiguration.class,
ElasticSearchReactiveHealthContributorAutoConfiguration.class, ElasticSearchReactiveHealthContributorAutoConfiguration.class,
HealthContributorAutoConfiguration.class)); HealthContributorAutoConfiguration.class));

@ -20,6 +20,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration; import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration;
import org.springframework.boot.autoconfigure.elasticsearch.ReactiveElasticsearchClientAutoConfiguration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;
@ -36,8 +37,8 @@ import org.springframework.data.elasticsearch.repository.config.EnableReactiveEl
* @see EnableElasticsearchRepositories * @see EnableElasticsearchRepositories
* @see EnableReactiveElasticsearchRepositories * @see EnableReactiveElasticsearchRepositories
*/ */
@AutoConfiguration(after = { ElasticsearchRestClientAutoConfiguration.class, @AutoConfiguration(
ReactiveElasticsearchRestClientAutoConfiguration.class }) after = { ElasticsearchRestClientAutoConfiguration.class, ReactiveElasticsearchClientAutoConfiguration.class })
@ConditionalOnClass({ ElasticsearchRestTemplate.class }) @ConditionalOnClass({ ElasticsearchRestTemplate.class })
@Import({ ElasticsearchDataConfiguration.BaseConfiguration.class, @Import({ ElasticsearchDataConfiguration.BaseConfiguration.class,
ElasticsearchDataConfiguration.RestClientConfiguration.class, ElasticsearchDataConfiguration.RestClientConfiguration.class,

@ -1,45 +0,0 @@
/*
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.data.elasticsearch;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.unit.DataSize;
/**
* Configuration properties for Elasticsearch Reactive REST clients.
*
* @author Brian Clozel
* @since 2.2.0
*/
@ConfigurationProperties(prefix = "spring.elasticsearch.webclient")
public class ReactiveElasticsearchRestClientProperties {
/**
* Limit on the number of bytes that can be buffered whenever the input stream needs
* to be aggregated.
*/
private DataSize maxInMemorySize;
public DataSize getMaxInMemorySize() {
return this.maxInMemorySize;
}
public void setMaxInMemorySize(DataSize maxInMemorySize) {
this.maxInMemorySize = maxInMemorySize;
}
}

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2021 the original author or authors. * Copyright 2012-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,6 +22,7 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.unit.DataSize;
/** /**
* Configuration properties for Elasticsearch. * Configuration properties for Elasticsearch.
@ -62,6 +63,10 @@ public class ElasticsearchProperties {
*/ */
private String pathPrefix; private String pathPrefix;
private final Restclient restclient = new Restclient();
private final Webclient webclient = new Webclient();
public List<String> getUris() { public List<String> getUris() {
return this.uris; return this.uris;
} }
@ -110,4 +115,70 @@ public class ElasticsearchProperties {
this.pathPrefix = pathPrefix; this.pathPrefix = pathPrefix;
} }
public Restclient getRestclient() {
return this.restclient;
}
public Webclient getWebclient() {
return this.webclient;
}
public static class Restclient {
private final Sniffer sniffer = new Sniffer();
public Sniffer getSniffer() {
return this.sniffer;
}
public static class Sniffer {
/**
* Interval between consecutive ordinary sniff executions.
*/
private Duration interval = Duration.ofMinutes(5);
/**
* Delay of a sniff execution scheduled after a failure.
*/
private Duration delayAfterFailure = Duration.ofMinutes(1);
public Duration getInterval() {
return this.interval;
}
public void setInterval(Duration interval) {
this.interval = interval;
}
public Duration getDelayAfterFailure() {
return this.delayAfterFailure;
}
public void setDelayAfterFailure(Duration delayAfterFailure) {
this.delayAfterFailure = delayAfterFailure;
}
}
}
public static class Webclient {
/**
* Limit on the number of bytes that can be buffered whenever the input stream
* needs to be aggregated.
*/
private DataSize maxInMemorySize;
public DataSize getMaxInMemorySize() {
return this.maxInMemorySize;
}
public void setMaxInMemorySize(DataSize maxInMemorySize) {
this.maxInMemorySize = maxInMemorySize;
}
}
} }

@ -38,7 +38,7 @@ import org.springframework.context.annotation.Import;
*/ */
@AutoConfiguration @AutoConfiguration
@ConditionalOnClass(RestClientBuilder.class) @ConditionalOnClass(RestClientBuilder.class)
@EnableConfigurationProperties({ ElasticsearchProperties.class, ElasticsearchRestClientProperties.class }) @EnableConfigurationProperties(ElasticsearchProperties.class)
@Import({ RestClientBuilderConfiguration.class, RestHighLevelClientConfiguration.class, @Import({ RestClientBuilderConfiguration.class, RestHighLevelClientConfiguration.class,
RestClientFromRestHighLevelClientConfiguration.class, RestClientConfiguration.class, RestClientFromRestHighLevelClientConfiguration.class, RestClientConfiguration.class,
RestClientSnifferConfiguration.class }) RestClientSnifferConfiguration.class })

@ -156,12 +156,12 @@ class ElasticsearchRestClientConfigurations {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
Sniffer elasticsearchSniffer(RestClient client, ElasticsearchRestClientProperties properties) { Sniffer elasticsearchSniffer(RestClient client, ElasticsearchProperties properties) {
SnifferBuilder builder = Sniffer.builder(client); SnifferBuilder builder = Sniffer.builder(client);
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull(); PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();
Duration interval = properties.getSniffer().getInterval(); Duration interval = properties.getRestclient().getSniffer().getInterval();
map.from(interval).asInt(Duration::toMillis).to(builder::setSniffIntervalMillis); map.from(interval).asInt(Duration::toMillis).to(builder::setSniffIntervalMillis);
Duration delayAfterFailure = properties.getSniffer().getDelayAfterFailure(); Duration delayAfterFailure = properties.getRestclient().getSniffer().getDelayAfterFailure();
map.from(delayAfterFailure).asInt(Duration::toMillis).to(builder::setSniffAfterFailureDelayMillis); map.from(delayAfterFailure).asInt(Duration::toMillis).to(builder::setSniffAfterFailureDelayMillis);
return builder.build(); return builder.build();
} }

@ -1,71 +0,0 @@
/*
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.elasticsearch;
import java.time.Duration;
import org.elasticsearch.client.RestClient;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Configuration properties specific to Elasticsearch's {@link RestClient} and
* {@link org.elasticsearch.client.RestHighLevelClient}.
*
* @author Brian Clozel
* @since 2.1.0
*/
@ConfigurationProperties(prefix = "spring.elasticsearch.restclient")
public class ElasticsearchRestClientProperties {
private final Sniffer sniffer = new Sniffer();
public Sniffer getSniffer() {
return this.sniffer;
}
public static class Sniffer {
/**
* Interval between consecutive ordinary sniff executions.
*/
private Duration interval = Duration.ofMinutes(5);
/**
* Delay of a sniff execution scheduled after a failure.
*/
private Duration delayAfterFailure = Duration.ofMinutes(1);
public Duration getInterval() {
return this.interval;
}
public void setInterval(Duration interval) {
this.interval = interval;
}
public Duration getDelayAfterFailure() {
return this.delayAfterFailure;
}
public void setDelayAfterFailure(Duration delayAfterFailure) {
this.delayAfterFailure = delayAfterFailure;
}
}
}

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.autoconfigure.data.elasticsearch; package org.springframework.boot.autoconfigure.elasticsearch;
import java.net.URI; import java.net.URI;
import java.time.Duration; import java.time.Duration;
@ -28,7 +28,6 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.context.properties.PropertyMapper; import org.springframework.boot.context.properties.PropertyMapper;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -47,18 +46,17 @@ import org.springframework.web.reactive.function.client.WebClient;
* clients. * clients.
* *
* @author Brian Clozel * @author Brian Clozel
* @since 2.2.0 * @since 3.0.0
*/ */
@AutoConfiguration @AutoConfiguration
@ConditionalOnClass({ ReactiveRestClients.class, WebClient.class, HttpClient.class }) @ConditionalOnClass({ ReactiveRestClients.class, WebClient.class, HttpClient.class })
@EnableConfigurationProperties({ ElasticsearchProperties.class, ReactiveElasticsearchRestClientProperties.class }) @EnableConfigurationProperties(ElasticsearchProperties.class)
public class ReactiveElasticsearchRestClientAutoConfiguration { public class ReactiveElasticsearchClientAutoConfiguration {
private final ConsolidatedProperties properties; private final ConsolidatedProperties properties;
ReactiveElasticsearchRestClientAutoConfiguration(ElasticsearchProperties properties, ReactiveElasticsearchClientAutoConfiguration(ElasticsearchProperties properties) {
ReactiveElasticsearchRestClientProperties restClientProperties) { this.properties = new ConsolidatedProperties(properties);
this.properties = new ConsolidatedProperties(properties, restClientProperties);
} }
@Bean @Bean
@ -98,14 +96,10 @@ public class ReactiveElasticsearchRestClientAutoConfiguration {
private final ElasticsearchProperties properties; private final ElasticsearchProperties properties;
private final ReactiveElasticsearchRestClientProperties restClientProperties;
private final List<URI> uris; private final List<URI> uris;
private ConsolidatedProperties(ElasticsearchProperties properties, private ConsolidatedProperties(ElasticsearchProperties properties) {
ReactiveElasticsearchRestClientProperties restClientProperties) {
this.properties = properties; this.properties = properties;
this.restClientProperties = restClientProperties;
this.uris = properties.getUris().stream().map((s) -> s.startsWith("http") ? s : "http://" + s) this.uris = properties.getUris().stream().map((s) -> s.startsWith("http") ? s : "http://" + s)
.map(URI::create).collect(Collectors.toList()); .map(URI::create).collect(Collectors.toList());
} }
@ -145,7 +139,7 @@ public class ReactiveElasticsearchRestClientAutoConfiguration {
} }
private DataSize getMaxInMemorySize() { private DataSize getMaxInMemorySize() {
return this.restClientProperties.getMaxInMemorySize(); return this.properties.getWebclient().getMaxInMemorySize();
} }
private String getPathPrefix() { private String getPathPrefix() {

@ -21,7 +21,6 @@ org.springframework.boot.autoconfigure.data.couchbase.CouchbaseRepositoriesAutoC
org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration
org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRepositoriesAutoConfiguration org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRestClientAutoConfiguration
org.springframework.boot.autoconfigure.data.jdbc.JdbcRepositoriesAutoConfiguration org.springframework.boot.autoconfigure.data.jdbc.JdbcRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.ldap.LdapRepositoriesAutoConfiguration org.springframework.boot.autoconfigure.data.ldap.LdapRepositoriesAutoConfiguration
@ -41,6 +40,7 @@ org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfigura
org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration
org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration
org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration
org.springframework.boot.autoconfigure.elasticsearch.ReactiveElasticsearchClientAutoConfiguration
org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration
org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration

@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage; import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
import org.springframework.boot.autoconfigure.data.elasticsearch.city.City; import org.springframework.boot.autoconfigure.data.elasticsearch.city.City;
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration; import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration;
import org.springframework.boot.autoconfigure.elasticsearch.ReactiveElasticsearchClientAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -56,7 +57,7 @@ class ElasticsearchDataAutoConfigurationTests {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ElasticsearchRestClientAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(ElasticsearchRestClientAutoConfiguration.class,
ReactiveElasticsearchRestClientAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class)); ReactiveElasticsearchClientAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class));
@BeforeEach @BeforeEach
void setUp() { void setUp() {

@ -29,6 +29,7 @@ import org.springframework.boot.autoconfigure.data.alt.elasticsearch.CityReactiv
import org.springframework.boot.autoconfigure.data.elasticsearch.city.City; import org.springframework.boot.autoconfigure.data.elasticsearch.city.City;
import org.springframework.boot.autoconfigure.data.elasticsearch.city.ReactiveCityRepository; import org.springframework.boot.autoconfigure.data.elasticsearch.city.ReactiveCityRepository;
import org.springframework.boot.autoconfigure.data.empty.EmptyDataPackage; import org.springframework.boot.autoconfigure.data.empty.EmptyDataPackage;
import org.springframework.boot.autoconfigure.elasticsearch.ReactiveElasticsearchClientAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.testsupport.testcontainers.DockerImageNames; import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -52,7 +53,7 @@ class ReactiveElasticsearchRepositoriesAutoConfigurationTests {
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10)); .withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(ReactiveElasticsearchClientAutoConfiguration.class,
ReactiveElasticsearchRepositoriesAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class)) ReactiveElasticsearchRepositoriesAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class))
.withPropertyValues( .withPropertyValues(
"spring.elasticsearch.uris=" + elasticsearch.getHost() + ":" + elasticsearch.getFirstMappedPort(), "spring.elasticsearch.uris=" + elasticsearch.getHost() + ":" + elasticsearch.getFirstMappedPort(),

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.autoconfigure.data.elasticsearch; package org.springframework.boot.autoconfigure.elasticsearch;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
@ -41,14 +41,14 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link ReactiveElasticsearchRestClientAutoConfiguration}. * Tests for {@link ReactiveElasticsearchClientAutoConfiguration}.
* *
* @author Brian Clozel * @author Brian Clozel
*/ */
class ReactiveElasticsearchRestClientAutoConfigurationTests { class ReactiveElasticsearchClientAutoConfigurationTests {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(ReactiveElasticsearchClientAutoConfiguration.class));
@Test @Test
void configureShouldCreateDefaultBeans() { void configureShouldCreateDefaultBeans() {

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.boot.autoconfigure.data.elasticsearch; package org.springframework.boot.autoconfigure.elasticsearch;
import java.time.Duration; import java.time.Duration;
import java.util.HashMap; import java.util.HashMap;
@ -36,7 +36,7 @@ import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsea
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Integration tests for {@link ReactiveElasticsearchRestClientAutoConfiguration}. * Integration tests for {@link ReactiveElasticsearchClientAutoConfiguration}.
* *
* @author Brian Clozel * @author Brian Clozel
*/ */
@ -48,7 +48,7 @@ class ReactiveElasticsearchRestClientAutoConfigurationIntegrationTests {
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10)); .withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class)); .withConfiguration(AutoConfigurations.of(ReactiveElasticsearchClientAutoConfiguration.class));
@Test @Test
void restClientCanQueryElasticsearchNode() { void restClientCanQueryElasticsearchNode() {

@ -1,6 +1,6 @@
# AutoConfigureDataElasticsearch auto-configuration imports # AutoConfigureDataElasticsearch auto-configuration imports
org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration
org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration
org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRestClientAutoConfiguration
org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRepositoriesAutoConfiguration org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration
org.springframework.boot.autoconfigure.elasticsearch.ReactiveElasticsearchClientAutoConfiguration

Loading…
Cancel
Save