diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticSearchReactiveHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticSearchReactiveHealthContributorAutoConfiguration.java index 2d43d22f8f..f90b77cd77 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticSearchReactiveHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticSearchReactiveHealthContributorAutoConfiguration.java @@ -29,7 +29,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; 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.data.elasticsearch.client.reactive.ReactiveElasticsearchClient; @@ -41,7 +41,7 @@ import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsea * @author Aleksander Lech * @since 2.3.2 */ -@AutoConfiguration(after = ReactiveElasticsearchRestClientAutoConfiguration.class) +@AutoConfiguration(after = ReactiveElasticsearchClientAutoConfiguration.class) @ConditionalOnClass({ ReactiveElasticsearchClient.class, Flux.class }) @ConditionalOnBean(ReactiveElasticsearchClient.class) @ConditionalOnEnabledHealthIndicator("elasticsearch") diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchReactiveHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchReactiveHealthContributorAutoConfigurationTests.java index 7cf3bce2fc..3b9646ba62 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchReactiveHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchReactiveHealthContributorAutoConfigurationTests.java @@ -23,8 +23,8 @@ import org.springframework.boot.actuate.elasticsearch.ElasticsearchReactiveHealt import org.springframework.boot.actuate.elasticsearch.ElasticsearchRestClientHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigurations; 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.ReactiveElasticsearchClientAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import static org.assertj.core.api.Assertions.assertThat; @@ -38,8 +38,7 @@ class ElasticsearchReactiveHealthContributorAutoConfigurationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(ElasticsearchDataAutoConfiguration.class, - ReactiveElasticsearchRestClientAutoConfiguration.class, - ElasticsearchRestClientAutoConfiguration.class, + ReactiveElasticsearchClientAutoConfiguration.class, ElasticsearchRestClientAutoConfiguration.class, ElasticSearchReactiveHealthContributorAutoConfiguration.class, HealthContributorAutoConfiguration.class)); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfiguration.java index 433c47fd88..25d156329a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfiguration.java @@ -20,6 +20,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration; +import org.springframework.boot.autoconfigure.elasticsearch.ReactiveElasticsearchClientAutoConfiguration; import org.springframework.context.annotation.Import; import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; @@ -36,8 +37,8 @@ import org.springframework.data.elasticsearch.repository.config.EnableReactiveEl * @see EnableElasticsearchRepositories * @see EnableReactiveElasticsearchRepositories */ -@AutoConfiguration(after = { ElasticsearchRestClientAutoConfiguration.class, - ReactiveElasticsearchRestClientAutoConfiguration.class }) +@AutoConfiguration( + after = { ElasticsearchRestClientAutoConfiguration.class, ReactiveElasticsearchClientAutoConfiguration.class }) @ConditionalOnClass({ ElasticsearchRestTemplate.class }) @Import({ ElasticsearchDataConfiguration.BaseConfiguration.class, ElasticsearchDataConfiguration.RestClientConfiguration.class, diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientProperties.java deleted file mode 100644 index 1673f1c2f8..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientProperties.java +++ /dev/null @@ -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; - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchProperties.java index 3810fedb82..4b155fd63f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchProperties.java @@ -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"); * 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 org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.util.unit.DataSize; /** * Configuration properties for Elasticsearch. @@ -62,6 +63,10 @@ public class ElasticsearchProperties { */ private String pathPrefix; + private final Restclient restclient = new Restclient(); + + private final Webclient webclient = new Webclient(); + public List getUris() { return this.uris; } @@ -110,4 +115,70 @@ public class ElasticsearchProperties { 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; + } + + } + } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientAutoConfiguration.java index a219abf000..9ae88f3cdb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientAutoConfiguration.java @@ -38,7 +38,7 @@ import org.springframework.context.annotation.Import; */ @AutoConfiguration @ConditionalOnClass(RestClientBuilder.class) -@EnableConfigurationProperties({ ElasticsearchProperties.class, ElasticsearchRestClientProperties.class }) +@EnableConfigurationProperties(ElasticsearchProperties.class) @Import({ RestClientBuilderConfiguration.class, RestHighLevelClientConfiguration.class, RestClientFromRestHighLevelClientConfiguration.class, RestClientConfiguration.class, RestClientSnifferConfiguration.class }) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientConfigurations.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientConfigurations.java index 903a4dc23f..c12c53f5b4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientConfigurations.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientConfigurations.java @@ -156,12 +156,12 @@ class ElasticsearchRestClientConfigurations { @Bean @ConditionalOnMissingBean - Sniffer elasticsearchSniffer(RestClient client, ElasticsearchRestClientProperties properties) { + Sniffer elasticsearchSniffer(RestClient client, ElasticsearchProperties properties) { SnifferBuilder builder = Sniffer.builder(client); 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); - Duration delayAfterFailure = properties.getSniffer().getDelayAfterFailure(); + Duration delayAfterFailure = properties.getRestclient().getSniffer().getDelayAfterFailure(); map.from(delayAfterFailure).asInt(Duration::toMillis).to(builder::setSniffAfterFailureDelayMillis); return builder.build(); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientProperties.java deleted file mode 100644 index 5d622dd133..0000000000 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ElasticsearchRestClientProperties.java +++ /dev/null @@ -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; - } - - } - -} diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ReactiveElasticsearchClientAutoConfiguration.java similarity index 89% rename from spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfiguration.java rename to spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ReactiveElasticsearchClientAutoConfiguration.java index 126d396add..f60d3da310 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/elasticsearch/ReactiveElasticsearchClientAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.elasticsearch; +package org.springframework.boot.autoconfigure.elasticsearch; import java.net.URI; 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.condition.ConditionalOnClass; 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.PropertyMapper; import org.springframework.context.annotation.Bean; @@ -47,18 +46,17 @@ import org.springframework.web.reactive.function.client.WebClient; * clients. * * @author Brian Clozel - * @since 2.2.0 + * @since 3.0.0 */ @AutoConfiguration @ConditionalOnClass({ ReactiveRestClients.class, WebClient.class, HttpClient.class }) -@EnableConfigurationProperties({ ElasticsearchProperties.class, ReactiveElasticsearchRestClientProperties.class }) -public class ReactiveElasticsearchRestClientAutoConfiguration { +@EnableConfigurationProperties(ElasticsearchProperties.class) +public class ReactiveElasticsearchClientAutoConfiguration { private final ConsolidatedProperties properties; - ReactiveElasticsearchRestClientAutoConfiguration(ElasticsearchProperties properties, - ReactiveElasticsearchRestClientProperties restClientProperties) { - this.properties = new ConsolidatedProperties(properties, restClientProperties); + ReactiveElasticsearchClientAutoConfiguration(ElasticsearchProperties properties) { + this.properties = new ConsolidatedProperties(properties); } @Bean @@ -98,14 +96,10 @@ public class ReactiveElasticsearchRestClientAutoConfiguration { private final ElasticsearchProperties properties; - private final ReactiveElasticsearchRestClientProperties restClientProperties; - private final List uris; - private ConsolidatedProperties(ElasticsearchProperties properties, - ReactiveElasticsearchRestClientProperties restClientProperties) { + private ConsolidatedProperties(ElasticsearchProperties properties) { this.properties = properties; - this.restClientProperties = restClientProperties; this.uris = properties.getUris().stream().map((s) -> s.startsWith("http") ? s : "http://" + s) .map(URI::create).collect(Collectors.toList()); } @@ -145,7 +139,7 @@ public class ReactiveElasticsearchRestClientAutoConfiguration { } private DataSize getMaxInMemorySize() { - return this.restClientProperties.getMaxInMemorySize(); + return this.properties.getWebclient().getMaxInMemorySize(); } private String getPathPrefix() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index beb66e6521..3be3ff4dd2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -21,7 +21,6 @@ org.springframework.boot.autoconfigure.data.couchbase.CouchbaseRepositoriesAutoC org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration 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.jpa.JpaRepositoriesAutoConfiguration 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.web.SpringDataWebAutoConfiguration org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration +org.springframework.boot.autoconfigure.elasticsearch.ReactiveElasticsearchClientAutoConfiguration org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java index cea52a6064..3d11a062e0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java @@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage; import org.springframework.boot.autoconfigure.data.elasticsearch.city.City; 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.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -56,7 +57,7 @@ class ElasticsearchDataAutoConfigurationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(ElasticsearchRestClientAutoConfiguration.class, - ReactiveElasticsearchRestClientAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class)); + ReactiveElasticsearchClientAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class)); @BeforeEach void setUp() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRepositoriesAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRepositoriesAutoConfigurationTests.java index 06b7379dda..761614be93 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRepositoriesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRepositoriesAutoConfigurationTests.java @@ -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.ReactiveCityRepository; 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.testsupport.testcontainers.DockerImageNames; import org.springframework.context.annotation.Configuration; @@ -52,7 +53,7 @@ class ReactiveElasticsearchRepositoriesAutoConfigurationTests { .withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10)); private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() - .withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class, + .withConfiguration(AutoConfigurations.of(ReactiveElasticsearchClientAutoConfiguration.class, ReactiveElasticsearchRepositoriesAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class)) .withPropertyValues( "spring.elasticsearch.uris=" + elasticsearch.getHost() + ":" + elasticsearch.getFirstMappedPort(), diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/ReactiveElasticsearchClientAutoConfigurationTests.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationTests.java rename to spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/ReactiveElasticsearchClientAutoConfigurationTests.java index abadc2af24..a9e1d99d2e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/ReactiveElasticsearchClientAutoConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.elasticsearch; +package org.springframework.boot.autoconfigure.elasticsearch; import java.net.InetSocketAddress; import java.nio.charset.StandardCharsets; @@ -41,14 +41,14 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; /** - * Tests for {@link ReactiveElasticsearchRestClientAutoConfiguration}. + * Tests for {@link ReactiveElasticsearchClientAutoConfiguration}. * * @author Brian Clozel */ -class ReactiveElasticsearchRestClientAutoConfigurationTests { +class ReactiveElasticsearchClientAutoConfigurationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() - .withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class)); + .withConfiguration(AutoConfigurations.of(ReactiveElasticsearchClientAutoConfiguration.class)); @Test void configureShouldCreateDefaultBeans() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationIntegrationTests.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationIntegrationTests.java rename to spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationIntegrationTests.java index eed064d708..c95b19f8bc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/ReactiveElasticsearchRestClientAutoConfigurationIntegrationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.data.elasticsearch; +package org.springframework.boot.autoconfigure.elasticsearch; import java.time.Duration; import java.util.HashMap; @@ -36,7 +36,7 @@ import org.springframework.data.elasticsearch.client.reactive.ReactiveElasticsea import static org.assertj.core.api.Assertions.assertThat; /** - * Integration tests for {@link ReactiveElasticsearchRestClientAutoConfiguration}. + * Integration tests for {@link ReactiveElasticsearchClientAutoConfiguration}. * * @author Brian Clozel */ @@ -48,7 +48,7 @@ class ReactiveElasticsearchRestClientAutoConfigurationIntegrationTests { .withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10)); private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() - .withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class)); + .withConfiguration(AutoConfigurations.of(ReactiveElasticsearchClientAutoConfiguration.class)); @Test void restClientCanQueryElasticsearchNode() { diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.elasticsearch.AutoConfigureDataElasticsearch.imports b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.elasticsearch.AutoConfigureDataElasticsearch.imports index 2c6ce3bef4..24274c9ff9 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.elasticsearch.AutoConfigureDataElasticsearch.imports +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.test.autoconfigure.data.elasticsearch.AutoConfigureDataElasticsearch.imports @@ -1,6 +1,6 @@ # AutoConfigureDataElasticsearch auto-configuration imports -org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration 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.elasticsearch.ElasticsearchRestClientAutoConfiguration +org.springframework.boot.autoconfigure.elasticsearch.ReactiveElasticsearchClientAutoConfiguration