diff --git a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentConfigurationProperties.java b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentConfigurationProperties.java index 0a9dfcd51a..221586300a 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentConfigurationProperties.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/context/properties/DocumentConfigurationProperties.java @@ -125,13 +125,13 @@ public class DocumentConfigurationProperties extends DefaultTask { private void dataPrefixes(Config config) { config.accept("spring.couchbase"); + config.accept("spring.cassandra"); config.accept("spring.elasticsearch"); config.accept("spring.h2"); config.accept("spring.influx"); config.accept("spring.ldap"); config.accept("spring.mongodb"); config.accept("spring.neo4j"); - config.accept("spring.redis"); config.accept("spring.dao"); config.accept("spring.data"); config.accept("spring.datasource"); 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/data/elasticsearch/ElasticsearchReactiveHealthContributorAutoConfiguration.java similarity index 93% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchReactiveHealthContributorAutoConfiguration.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/elasticsearch/ElasticsearchReactiveHealthContributorAutoConfiguration.java index ab3c640b7b..2e4c6295c7 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/data/elasticsearch/ElasticsearchReactiveHealthContributorAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.elasticsearch; +package org.springframework.boot.actuate.autoconfigure.data.elasticsearch; import java.util.Map; @@ -22,7 +22,7 @@ import reactor.core.publisher.Flux; import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; -import org.springframework.boot.actuate.elasticsearch.ElasticsearchReactiveHealthIndicator; +import org.springframework.boot.actuate.data.elasticsearch.ElasticsearchReactiveHealthIndicator; import org.springframework.boot.actuate.health.ReactiveHealthContributor; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/elasticsearch/package-info.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/elasticsearch/package-info.java new file mode 100644 index 0000000000..5a470dd105 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/elasticsearch/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Auto-configuration for actuator Elasticsearch concerns dependent on Spring Data. + */ +package org.springframework.boot.actuate.autoconfigure.data.elasticsearch; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/mongo/MongoHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/mongo/MongoHealthContributorAutoConfiguration.java similarity index 94% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/mongo/MongoHealthContributorAutoConfiguration.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/mongo/MongoHealthContributorAutoConfiguration.java index 5114c44ff4..b7880f7c95 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/mongo/MongoHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/mongo/MongoHealthContributorAutoConfiguration.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.mongo; +package org.springframework.boot.actuate.autoconfigure.data.mongo; import java.util.Map; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; +import org.springframework.boot.actuate.data.mongo.MongoHealthIndicator; import org.springframework.boot.actuate.health.HealthContributor; -import org.springframework.boot.actuate.mongo.MongoHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/mongo/MongoReactiveHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/mongo/MongoReactiveHealthContributorAutoConfiguration.java similarity index 94% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/mongo/MongoReactiveHealthContributorAutoConfiguration.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/mongo/MongoReactiveHealthContributorAutoConfiguration.java index d64538dc9c..805bcd458e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/mongo/MongoReactiveHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/mongo/MongoReactiveHealthContributorAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.mongo; +package org.springframework.boot.actuate.autoconfigure.data.mongo; import java.util.Map; @@ -22,8 +22,8 @@ import reactor.core.publisher.Flux; import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; +import org.springframework.boot.actuate.data.mongo.MongoReactiveHealthIndicator; import org.springframework.boot.actuate.health.ReactiveHealthContributor; -import org.springframework.boot.actuate.mongo.MongoReactiveHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mongo/package-info.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/mongo/package-info.java similarity index 81% rename from spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mongo/package-info.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/mongo/package-info.java index d4da9c1679..084c5f6970 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mongo/package-info.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/mongo/package-info.java @@ -15,6 +15,6 @@ */ /** - * Actuator support for Mongo. + * Auto-configuration for actuator MongoDB concerns dependent on Spring Data. */ -package org.springframework.boot.actuate.mongo; +package org.springframework.boot.actuate.autoconfigure.data.mongo; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/package-info.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/package-info.java new file mode 100644 index 0000000000..351854bb89 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Auto-configuration for actuator concerns dependent on Spring Data. + */ +package org.springframework.boot.actuate.autoconfigure.data; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/redis/RedisHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfiguration.java similarity index 94% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/redis/RedisHealthContributorAutoConfiguration.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfiguration.java index 7a59f1e5f4..41fda7a222 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/redis/RedisHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfiguration.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.redis; +package org.springframework.boot.actuate.autoconfigure.data.redis; import java.util.Map; import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; +import org.springframework.boot.actuate.data.redis.RedisHealthIndicator; import org.springframework.boot.actuate.health.HealthContributor; -import org.springframework.boot.actuate.redis.RedisHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/redis/RedisReactiveHealthContributorAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java similarity index 94% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/redis/RedisReactiveHealthContributorAutoConfiguration.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java index e6ae77ebc1..489694e6c9 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/redis/RedisReactiveHealthContributorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.redis; +package org.springframework.boot.actuate.autoconfigure.data.redis; import java.util.Map; @@ -22,8 +22,8 @@ import reactor.core.publisher.Flux; import org.springframework.boot.actuate.autoconfigure.health.CompositeReactiveHealthContributorConfiguration; import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; +import org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator; import org.springframework.boot.actuate.health.ReactiveHealthContributor; -import org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/redis/package-info.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/package-info.java similarity index 81% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/redis/package-info.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/package-info.java index 5af57587cb..2e935648a4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/redis/package-info.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/data/redis/package-info.java @@ -15,6 +15,6 @@ */ /** - * Auto-configuration for actuator Redis concerns. + * Auto-configuration for actuator Redis concerns dependent on Spring Data. */ -package org.springframework.boot.actuate.autoconfigure.redis; +package org.springframework.boot.actuate.autoconfigure.data.redis; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index d1df923b28..751825bd6f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -14,7 +14,7 @@ org.springframework.boot.actuate.autoconfigure.context.properties.ConfigurationP org.springframework.boot.actuate.autoconfigure.context.ShutdownEndpointAutoConfiguration org.springframework.boot.actuate.autoconfigure.couchbase.CouchbaseHealthContributorAutoConfiguration org.springframework.boot.actuate.autoconfigure.couchbase.CouchbaseReactiveHealthContributorAutoConfiguration -org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticsearchReactiveHealthContributorAutoConfiguration +org.springframework.boot.actuate.autoconfigure.data.elasticsearch.ElasticsearchReactiveHealthContributorAutoConfiguration org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticsearchRestHealthContributorAutoConfiguration org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration @@ -81,14 +81,14 @@ org.springframework.boot.actuate.autoconfigure.metrics.web.jetty.JettyMetricsAut org.springframework.boot.actuate.autoconfigure.metrics.web.reactive.WebFluxMetricsAutoConfiguration org.springframework.boot.actuate.autoconfigure.metrics.web.servlet.WebMvcMetricsAutoConfiguration org.springframework.boot.actuate.autoconfigure.metrics.web.tomcat.TomcatMetricsAutoConfiguration -org.springframework.boot.actuate.autoconfigure.mongo.MongoHealthContributorAutoConfiguration -org.springframework.boot.actuate.autoconfigure.mongo.MongoReactiveHealthContributorAutoConfiguration +org.springframework.boot.actuate.autoconfigure.data.mongo.MongoHealthContributorAutoConfiguration +org.springframework.boot.actuate.autoconfigure.data.mongo.MongoReactiveHealthContributorAutoConfiguration org.springframework.boot.actuate.autoconfigure.neo4j.Neo4jHealthContributorAutoConfiguration org.springframework.boot.actuate.autoconfigure.observation.ObservationAutoConfiguration org.springframework.boot.actuate.autoconfigure.quartz.QuartzEndpointAutoConfiguration org.springframework.boot.actuate.autoconfigure.r2dbc.ConnectionFactoryHealthContributorAutoConfiguration -org.springframework.boot.actuate.autoconfigure.redis.RedisHealthContributorAutoConfiguration -org.springframework.boot.actuate.autoconfigure.redis.RedisReactiveHealthContributorAutoConfiguration +org.springframework.boot.actuate.autoconfigure.data.redis.RedisHealthContributorAutoConfiguration +org.springframework.boot.actuate.autoconfigure.data.redis.RedisReactiveHealthContributorAutoConfiguration org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksEndpointAutoConfiguration org.springframework.boot.actuate.autoconfigure.security.reactive.ReactiveManagementWebSecurityAutoConfiguration org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration 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/data/elasticsearch/ElasticsearchReactiveHealthContributorAutoConfigurationTests.java similarity index 90% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchReactiveHealthContributorAutoConfigurationTests.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/elasticsearch/ElasticsearchReactiveHealthContributorAutoConfigurationTests.java index fbe84d42af..789bbb6bf9 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/data/elasticsearch/ElasticsearchReactiveHealthContributorAutoConfigurationTests.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.elasticsearch; +package org.springframework.boot.actuate.autoconfigure.data.elasticsearch; import org.junit.jupiter.api.Test; +import org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticsearchRestHealthContributorAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; -import org.springframework.boot.actuate.elasticsearch.ElasticsearchReactiveHealthIndicator; +import org.springframework.boot.actuate.data.elasticsearch.ElasticsearchReactiveHealthIndicator; import org.springframework.boot.actuate.elasticsearch.ElasticsearchRestClientHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/mongo/MongoHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/mongo/MongoHealthContributorAutoConfigurationTests.java similarity index 93% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/mongo/MongoHealthContributorAutoConfigurationTests.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/mongo/MongoHealthContributorAutoConfigurationTests.java index 02a763d734..32e52921b7 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/mongo/MongoHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/mongo/MongoHealthContributorAutoConfigurationTests.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.mongo; +package org.springframework.boot.actuate.autoconfigure.data.mongo; import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; -import org.springframework.boot.actuate.mongo.MongoHealthIndicator; +import org.springframework.boot.actuate.data.mongo.MongoHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration; import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/mongo/MongoReactiveHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/mongo/MongoReactiveHealthContributorAutoConfigurationTests.java similarity index 92% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/mongo/MongoReactiveHealthContributorAutoConfigurationTests.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/mongo/MongoReactiveHealthContributorAutoConfigurationTests.java index 7b37b22711..18144e3c4b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/mongo/MongoReactiveHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/mongo/MongoReactiveHealthContributorAutoConfigurationTests.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.mongo; +package org.springframework.boot.actuate.autoconfigure.data.mongo; import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; -import org.springframework.boot.actuate.mongo.MongoHealthIndicator; -import org.springframework.boot.actuate.mongo.MongoReactiveHealthIndicator; +import org.springframework.boot.actuate.data.mongo.MongoHealthIndicator; +import org.springframework.boot.actuate.data.mongo.MongoReactiveHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration; import org.springframework.boot.autoconfigure.data.mongo.MongoReactiveDataAutoConfiguration; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/redis/RedisHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfigurationTests.java similarity index 90% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/redis/RedisHealthContributorAutoConfigurationTests.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfigurationTests.java index ff100f4359..0046a0c1d1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/redis/RedisHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisHealthContributorAutoConfigurationTests.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.redis; +package org.springframework.boot.actuate.autoconfigure.data.redis; import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; -import org.springframework.boot.actuate.redis.RedisHealthIndicator; -import org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator; +import org.springframework.boot.actuate.data.redis.RedisHealthIndicator; +import org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/redis/RedisReactiveHealthContributorAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfigurationTests.java similarity index 91% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/redis/RedisReactiveHealthContributorAutoConfigurationTests.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfigurationTests.java index 846fff6dce..17c9f4e040 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/redis/RedisReactiveHealthContributorAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/data/redis/RedisReactiveHealthContributorAutoConfigurationTests.java @@ -14,13 +14,13 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.redis; +package org.springframework.boot.actuate.autoconfigure.data.redis; import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration; -import org.springframework.boot.actuate.redis.RedisHealthIndicator; -import org.springframework.boot.actuate.redis.RedisReactiveHealthIndicator; +import org.springframework.boot.actuate.data.redis.RedisHealthIndicator; +import org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; import org.springframework.boot.test.context.runner.ApplicationContextRunner; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/elasticsearch/ElasticsearchReactiveHealthIndicator.java similarity index 98% rename from spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicator.java rename to spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/elasticsearch/ElasticsearchReactiveHealthIndicator.java index 93a872777d..30b7326f1d 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/elasticsearch/ElasticsearchReactiveHealthIndicator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.elasticsearch; +package org.springframework.boot.actuate.data.elasticsearch; import co.elastic.clients.elasticsearch._types.HealthStatus; import co.elastic.clients.elasticsearch.cluster.HealthResponse; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/elasticsearch/package-info.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/elasticsearch/package-info.java new file mode 100644 index 0000000000..9ac49b3e86 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/elasticsearch/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Actuator support for Elasticsearch dependent on Spring Data. + */ +package org.springframework.boot.actuate.data.elasticsearch; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mongo/MongoHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/MongoHealthIndicator.java similarity index 93% rename from spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mongo/MongoHealthIndicator.java rename to spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/MongoHealthIndicator.java index 669341fdfb..a320adf255 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mongo/MongoHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/MongoHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.mongo; +package org.springframework.boot.actuate.data.mongo; import org.bson.Document; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mongo/MongoReactiveHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/MongoReactiveHealthIndicator.java similarity index 94% rename from spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mongo/MongoReactiveHealthIndicator.java rename to spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/MongoReactiveHealthIndicator.java index d518d11a47..6ad9cdd5e3 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mongo/MongoReactiveHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/MongoReactiveHealthIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.mongo; +package org.springframework.boot.actuate.data.mongo; import org.bson.Document; import reactor.core.publisher.Mono; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/mongo/package-info.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/package-info.java similarity index 77% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/mongo/package-info.java rename to spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/package-info.java index 5f55c14254..5f04172c15 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/mongo/package-info.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/mongo/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 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. @@ -15,6 +15,6 @@ */ /** - * Auto-configuration for actuator MongoDB concerns. + * Actuator support for Mongo dependent on Spring Data. */ -package org.springframework.boot.actuate.autoconfigure.mongo; +package org.springframework.boot.actuate.data.mongo; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/package-info.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/package-info.java similarity index 79% rename from spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/package-info.java rename to spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/package-info.java index 2cda2a17a8..a0cc5b1de4 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/package-info.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 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. @@ -15,6 +15,6 @@ */ /** - * Actuator support for Redis. + * Actuator support dependent on Spring Data. */ -package org.springframework.boot.actuate.redis; +package org.springframework.boot.actuate.data; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/RedisHealth.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealth.java similarity index 93% rename from spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/RedisHealth.java rename to spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealth.java index 943c2a19aa..ca774f2152 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/RedisHealth.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealth.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. @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.redis; +package org.springframework.boot.actuate.data.redis; import java.util.Properties; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/RedisHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealthIndicator.java similarity index 97% rename from spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/RedisHealthIndicator.java rename to spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealthIndicator.java index 92e59aa8f9..eaa3fbab86 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/RedisHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisHealthIndicator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.redis; +package org.springframework.boot.actuate.data.redis; import org.springframework.boot.actuate.health.AbstractHealthIndicator; import org.springframework.boot.actuate.health.Health; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/RedisReactiveHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisReactiveHealthIndicator.java similarity index 98% rename from spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/RedisReactiveHealthIndicator.java rename to spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisReactiveHealthIndicator.java index c565b4a5dd..e8d54423a2 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/redis/RedisReactiveHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/RedisReactiveHealthIndicator.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.redis; +package org.springframework.boot.actuate.data.redis; import java.util.Properties; diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/package-info.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/package-info.java new file mode 100644 index 0000000000..2b0a7fbbc7 --- /dev/null +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/data/redis/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/** + * Actuator support for Redis dependent on Spring Data. + */ +package org.springframework.boot.actuate.data.redis; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicatorTests.java index cbdcba1753..fa614ead00 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchReactiveHealthIndicatorTests.java @@ -30,6 +30,7 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.springframework.boot.actuate.data.elasticsearch.ElasticsearchReactiveHealthIndicator; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Status; import org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchClient; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SanitizerTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SanitizerTests.java index a29771f058..fdcc72fe82 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SanitizerTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/SanitizerTests.java @@ -49,7 +49,7 @@ class SanitizerTests { assertThat(sanitizer.sanitize("token", "secret")).isEqualTo("******"); assertThat(sanitizer.sanitize("sometoken", "secret")).isEqualTo("******"); assertThat(sanitizer.sanitize("find", "secret")).isEqualTo("secret"); - assertThat(sanitizer.sanitize("sun.java.command", "--spring.redis.password=pa55w0rd")).isEqualTo("******"); + assertThat(sanitizer.sanitize("sun.java.command", "--spring.data.redis.password=pa55w0rd")).isEqualTo("******"); assertThat(sanitizer.sanitize("SPRING_APPLICATION_JSON", "{password:123}")).isEqualTo("******"); assertThat(sanitizer.sanitize("spring.application.json", "{password:123}")).isEqualTo("******"); assertThat(sanitizer.sanitize("VCAP_SERVICES", "{json}")).isEqualTo("******"); @@ -68,7 +68,7 @@ class SanitizerTests { assertThat(sanitizer.sanitize("token", "secret")).isEqualTo("******"); assertThat(sanitizer.sanitize("sometoken", "secret")).isEqualTo("******"); assertThat(sanitizer.sanitize("find", "secret")).isEqualTo("******"); - assertThat(sanitizer.sanitize("sun.java.command", "--spring.redis.password=pa55w0rd")).isEqualTo("******"); + assertThat(sanitizer.sanitize("sun.java.command", "--spring.data.redis.password=pa55w0rd")).isEqualTo("******"); assertThat(sanitizer.sanitize("confidential", "secret")).isEqualTo("******"); assertThat(sanitizer.sanitize("private", "secret")).isEqualTo("secret"); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/RedisCacheMetricsTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/RedisCacheMetricsTests.java index 38d6af150c..131d03a7ad 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/RedisCacheMetricsTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/cache/RedisCacheMetricsTests.java @@ -56,7 +56,7 @@ class RedisCacheMetricsTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class, CacheAutoConfiguration.class)) .withUserConfiguration(CachingConfiguration.class).withPropertyValues( - "spring.redis.host=" + redis.getHost(), "spring.redis.port=" + redis.getFirstMappedPort(), + "spring.data.redis.host=" + redis.getHost(), "spring.data.redis.port=" + redis.getFirstMappedPort(), "spring.cache.type=redis", "spring.cache.redis.enable-statistics=true"); @Test diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mongo/MongoHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mongo/MongoHealthIndicatorTests.java index 0ad1de2b2c..fd5c5d4ec7 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mongo/MongoHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mongo/MongoHealthIndicatorTests.java @@ -20,6 +20,7 @@ import com.mongodb.MongoException; import org.bson.Document; import org.junit.jupiter.api.Test; +import org.springframework.boot.actuate.data.mongo.MongoHealthIndicator; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Status; import org.springframework.data.mongodb.core.MongoTemplate; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mongo/MongoReactiveHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mongo/MongoReactiveHealthIndicatorTests.java index 582dc58507..acc66db310 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mongo/MongoReactiveHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mongo/MongoReactiveHealthIndicatorTests.java @@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; +import org.springframework.boot.actuate.data.mongo.MongoReactiveHealthIndicator; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Status; import org.springframework.data.mongodb.core.ReactiveMongoTemplate; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisHealthIndicatorTests.java index 790f104564..1e60e7da4a 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisHealthIndicatorTests.java @@ -22,6 +22,7 @@ import java.util.Properties; import org.junit.jupiter.api.Test; +import org.springframework.boot.actuate.data.redis.RedisHealthIndicator; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Status; import org.springframework.data.redis.RedisConnectionFailureException; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisReactiveHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisReactiveHealthIndicatorTests.java index f45b25eb92..5767560504 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisReactiveHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/redis/RedisReactiveHealthIndicatorTests.java @@ -23,6 +23,7 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; +import org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Status; import org.springframework.data.redis.RedisConnectionFailureException; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java index 9d27303871..d4f6c67dde 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java @@ -33,7 +33,7 @@ import org.springframework.core.io.Resource; * @author Stephane Nicoll * @since 1.3.0 */ -@ConfigurationProperties(prefix = "spring.data.cassandra") +@ConfigurationProperties(prefix = "spring.cassandra") public class CassandraProperties { /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfiguration.java index 2bdb8013c5..2f86b6c2b6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfiguration.java @@ -108,7 +108,7 @@ public class CassandraDataAutoConfiguration { session.setSession(this.session); session.setConverter(converter); Binder binder = Binder.get(environment); - binder.bind("spring.data.cassandra.schema-action", SchemaAction.class).ifBound(session::setSchemaAction); + binder.bind("spring.cassandra.schema-action", SchemaAction.class).ifBound(session::setSchemaAction); return session; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/JedisConnectionConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/JedisConnectionConfiguration.java index 41b1177da2..de01047c6b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/JedisConnectionConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/JedisConnectionConfiguration.java @@ -46,7 +46,7 @@ import org.springframework.util.StringUtils; @Configuration(proxyBeanMethods = false) @ConditionalOnClass({ GenericObjectPool.class, JedisConnection.class, Jedis.class }) @ConditionalOnMissingBean(RedisConnectionFactory.class) -@ConditionalOnProperty(name = "spring.redis.client-type", havingValue = "jedis", matchIfMissing = true) +@ConditionalOnProperty(name = "spring.data.redis.client-type", havingValue = "jedis", matchIfMissing = true) class JedisConnectionConfiguration extends RedisConnectionConfiguration { JedisConnectionConfiguration(RedisProperties properties, diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.java index c037899bdc..7bbcee4d81 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/LettuceConnectionConfiguration.java @@ -55,7 +55,7 @@ import org.springframework.util.StringUtils; */ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(RedisClient.class) -@ConditionalOnProperty(name = "spring.redis.client-type", havingValue = "lettuce", matchIfMissing = true) +@ConditionalOnProperty(name = "spring.data.redis.client-type", havingValue = "lettuce", matchIfMissing = true) class LettuceConnectionConfiguration extends RedisConnectionConfiguration { LettuceConnectionConfiguration(RedisProperties properties, diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java index 89cb977a62..7ceb073b4a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java @@ -32,7 +32,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Stephane Nicoll * @since 1.0.0 */ -@ConfigurationProperties(prefix = "spring.redis") +@ConfigurationProperties(prefix = "spring.data.redis") public class RedisProperties { /** diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzer.java index 4550c462d2..f364e417f9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzer.java @@ -36,12 +36,12 @@ class RedisUrlSyntaxFailureAnalyzer extends AbstractFailureAnalyzer", @@ -616,25 +657,53 @@ }, { "name": "spring.data.cassandra.compression", - "defaultValue": "none" + "defaultValue": "none", + "deprecation": { + "replacement": "spring.cassandra.compression", + "level": "error" + } + }, + { + "name": "spring.data.cassandra.config", + "type": "org.springframework.core.io.Resource", + "deprecation": { + "replacement": "spring.cassandra.config", + "level": "error" + } }, { "name": "spring.data.cassandra.connection.connect-timeout", - "defaultValue": "5s" + "defaultValue": "5s", + "deprecation": { + "replacement": "spring.cassandra.connection.connect-timeout", + "level": "error" + } }, { "name": "spring.data.cassandra.connection.init-query-timeout", - "defaultValue": "5s" + "defaultValue": "5s", + "deprecation": { + "replacement": "spring.cassandra.connection.init-query-timeout", + "level": "error" + } }, { "name": "spring.data.cassandra.contact-points", "defaultValue": [ "127.0.0.1:9042" - ] + ], + "deprecation": { + "replacement": "spring.cassandra.contact-points", + "level": "error" + } }, { "name": "spring.data.cassandra.controlconnection.timeout", - "defaultValue": "5s" + "defaultValue": "5s", + "deprecation": { + "replacement": "spring.cassandra.controlconnection.timeout", + "level": "error" + } }, { "name": "spring.data.cassandra.jmx-enabled", @@ -645,6 +714,14 @@ "level": "error" } }, + { + "name": "spring.data.cassandra.keyspace-name", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.cassandra.keyspace-name", + "level": "error" + } + }, { "name": "spring.data.cassandra.load-balancing-policy", "type": "java.lang.Class", @@ -653,19 +730,43 @@ "level": "error" } }, + { + "name": "spring.data.cassandra.local-datacenter", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.cassandra.local-datacenter", + "level": "error" + } + }, + { + "name": "spring.data.cassandra.password", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.cassandra.password", + "level": "error" + } + }, { "name": "spring.data.cassandra.pool.heartbeat-interval", - "defaultValue": "30s" + "defaultValue": "30s", + "deprecation": { + "replacement": "spring.cassandra.pool.heartbeat-interval", + "level": "error" + } }, { "name": "spring.data.cassandra.pool.idle-timeout", - "defaultValue": "5s" + "defaultValue": "5s", + "deprecation": { + "replacement": "spring.cassandra.pool.idle-timeout", + "level": "error" + } }, { "name": "spring.data.cassandra.pool.max-queue-size", "type": "java.lang.Integer", "deprecation": { - "replacement": "spring.data.cassandra.request.throttler.max-queue-size", + "replacement": "spring.cassandra.request.throttler.max-queue-size", "level": "error" } }, @@ -678,6 +779,14 @@ "level": "error" } }, + { + "name": "spring.data.cassandra.port", + "type": "java.lang.Integer", + "deprecation": { + "replacement": "spring.cassandra.port", + "level": "error" + } + }, { "name": "spring.data.cassandra.reconnection-policy", "type": "java.lang.Class", @@ -692,17 +801,77 @@ "description": "Type of Cassandra repositories to enable.", "defaultValue": "auto" }, + { + "name": "spring.data.cassandra.request.consistency", + "type": "com.datastax.oss.driver.api.core.DefaultConsistencyLevel", + "deprecation": { + "replacement": "spring.cassandra.request.consistency", + "level": "error" + } + }, { "name": "spring.data.cassandra.request.page-size", - "defaultValue": 5000 + "defaultValue": 5000, + "deprecation": { + "replacement": "spring.cassandra.request.page-size", + "level": "error" + } + }, + { + "name": "spring.data.cassandra.request.serial-consistency", + "type": "com.datastax.oss.driver.api.core.DefaultConsistencyLevel", + "deprecation": { + "replacement": "spring.cassandra.request.serial-consistency", + "level": "error" + } + }, + { + "name": "spring.data.cassandra.request.throttler.drain-interval", + "type": "java.time.Duration", + "deprecation": { + "replacement": "spring.cassandra.request.throttler.drain-interval", + "level": "error" + } + }, + { + "name": "spring.data.cassandra.request.throttler.max-concurrent-requests", + "type": "java.lang.Integer", + "deprecation": { + "replacement": "spring.cassandra.request.throttler.max-concurrent-requests", + "level": "error" + } + }, + { + "name": "spring.data.cassandra.request.throttler.max-queue-size", + "type": "java.lang.Integer", + "deprecation": { + "replacement": "spring.cassandra.request.throttler.max-queue-size", + "level": "error" + } + }, + { + "name": "spring.data.cassandra.request.throttler.max-requests-per-second", + "type": "java.lang.Integer", + "deprecation": { + "replacement": "spring.cassandra.request.throttler.max-requests-per-second", + "level": "error" + } }, { "name": "spring.data.cassandra.request.throttler.type", - "defaultValue": "none" + "defaultValue": "none", + "deprecation": { + "replacement": "spring.cassandra.request.throttler.type", + "level": "error" + } }, { "name": "spring.data.cassandra.request.timeout", - "defaultValue": "2s" + "defaultValue": "2s", + "deprecation": { + "replacement": "spring.cassandra.request.timeout", + "level": "error" + } }, { "name": "spring.data.cassandra.retry-policy", @@ -712,6 +881,38 @@ "level": "error" } }, + { + "name": "spring.data.cassandra.schema-action", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.cassandra.schema-action", + "level": "error" + } + }, + { + "name": "spring.data.cassandra.session-name", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.cassandra.session-name", + "level": "error" + } + }, + { + "name": "spring.data.cassandra.ssl", + "type": "java.lang.Boolean", + "deprecation": { + "replacement": "spring.cassandra.ssl", + "level": "error" + } + }, + { + "name": "spring.data.cassandra.username", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.cassandra.username", + "level": "error" + } + }, { "name": "spring.data.couchbase.consistency", "type": "org.springframework.data.couchbase.core.query.Consistency", @@ -1995,6 +2196,258 @@ "replacement": "spring.reactor.debug-agent.enabled" } }, + { + "name": "spring.redis.client-name", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.client-name", + "level": "error" + } + }, + { + "name": "spring.redis.client-type", + "type": "org.springframework.boot.autoconfigure.data.redis.RedisProperties$ClientType", + "deprecation": { + "replacement": "spring.data.redis.client-type", + "level": "error" + } + }, + { + "name": "spring.redis.cluster.max-redirects", + "type": "java.lang.Integer", + "deprecation": { + "replacement": "spring.data.redis.cluster.max-redirects", + "level": "error" + } + }, + { + "name": "spring.redis.cluster.nodes", + "type": "java.util.List", + "deprecation": { + "replacement": "spring.data.redis.cluster.nodes", + "level": "error" + } + }, + { + "name": "spring.redis.connect-timeout", + "type": "java.time.Duration", + "deprecation": { + "replacement": "spring.data.redis.connect-timeout", + "level": "error" + } + }, + { + "name": "spring.redis.database", + "type": "java.lang.Integer", + "deprecation": { + "replacement": "spring.data.redis.database", + "level": "error" + } + }, + { + "name": "spring.redis.host", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.host", + "level": "error" + } + }, + { + "name": "spring.redis.jedis.pool.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.jedis.pool.max-active", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.jedis.pool.max-idle", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.jedis.pool.max-wait", + "type": "java.time.Duration", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.jedis.pool.min-idle", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.jedis.pool.time-between-eviction-runs", + "type": "java.time.Duration", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.cluster.refresh.adaptive", + "type": "java.lang.Boolean", + "deprecation": { + "replacement": "spring.data.redis.lettuce.cluster.refresh.adaptive", + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.cluster.refresh.dynamic-refresh-sources", + "type": "java.lang.Boolean", + "deprecation": { + "replacement": "spring.data.redis.lettuce.cluster.refresh.dynamic-refresh-sources", + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.cluster.refresh.period", + "type": "java.time.Duration", + "deprecation": { + "replacement": "spring.data.redis.lettuce.cluster.refresh.period", + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.pool.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.pool.max-active", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.pool.max-idle", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.pool.max-wait", + "type": "java.time.Duration", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.pool.min-idle", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.pool.time-between-eviction-runs", + "type": "java.time.Duration", + "deprecation": { + "level": "error" + } + }, + { + "name": "spring.redis.lettuce.shutdown-timeout", + "type": "java.time.Duration", + "deprecation": { + "replacement": "spring.data.redis.lettuce.shutdown-timeout", + "level": "error" + } + }, + { + "name": "spring.redis.password", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.password", + "level": "error" + } + }, + { + "name": "spring.redis.port", + "type": "java.lang.Integer", + "deprecation": { + "replacement": "spring.data.redis.port", + "level": "error" + } + }, + { + "name": "spring.redis.sentinel.master", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.sentinel.master", + "level": "error" + } + }, + { + "name": "spring.redis.sentinel.nodes", + "type": "java.util.List", + "deprecation": { + "replacement": "spring.data.redis.sentinel.nodes", + "level": "error" + } + }, + { + "name": "spring.redis.sentinel.password", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.sentinel.password", + "level": "error" + } + }, + { + "name": "spring.redis.sentinel.username", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.sentinel.username", + "level": "error" + } + }, + { + "name": "spring.redis.ssl", + "type": "java.lang.Boolean", + "deprecation": { + "replacement": "spring.data.redis.ssl", + "level": "error" + } + }, + { + "name": "spring.redis.timeout", + "type": "java.time.Duration", + "deprecation": { + "replacement": "spring.data.redis.timeout", + "level": "error" + } + }, + { + "name": "spring.redis.url", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.url", + "level": "error" + } + }, + { + "name": "spring.redis.username", + "type": "java.lang.String", + "deprecation": { + "replacement": "spring.data.redis.username", + "level": "error" + } + }, { "name": "spring.resources.add-mappings", "type": "java.lang.Boolean", @@ -2509,7 +2962,7 @@ ] }, { - "name": "spring.data.cassandra.schema-action", + "name": "spring.cassandra.schema-action", "providers": [ { "name": "handle-as", @@ -2929,4 +3382,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationIntegrationTests.java index 198289618f..143f4654ff 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationIntegrationTests.java @@ -47,12 +47,9 @@ class CassandraAutoConfigurationIntegrationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(CassandraAutoConfiguration.class)).withPropertyValues( - "spring.data.cassandra.contact-points:" + cassandra.getHost() + ":" - + cassandra.getFirstMappedPort(), - "spring.data.cassandra.local-datacenter=datacenter1", - "spring.data.cassandra.connection.connect-timeout=60s", - "spring.data.cassandra.connection.init-query-timeout=60s", - "spring.data.cassandra.request.timeout=60s"); + "spring.cassandra.contact-points:" + cassandra.getHost() + ":" + cassandra.getFirstMappedPort(), + "spring.cassandra.local-datacenter=datacenter1", "spring.cassandra.connection.connect-timeout=60s", + "spring.cassandra.connection.init-query-timeout=60s", "spring.cassandra.request.timeout=60s"); @Test void whenTheContextIsClosedThenTheDriverConfigLoaderIsClosed() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationTests.java index 971ec02b7e..ada065306f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationTests.java @@ -73,8 +73,8 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderWithContactPoints() { - this.contextRunner.withPropertyValues("spring.data.cassandra.contact-points=cluster.example.com:9042", - "spring.data.cassandra.local-datacenter=cassandra-eu1").run((context) -> { + this.contextRunner.withPropertyValues("spring.cassandra.contact-points=cluster.example.com:9042", + "spring.cassandra.local-datacenter=cassandra-eu1").run((context) -> { assertThat(context).hasSingleBean(DriverConfigLoader.class); DriverExecutionProfile configuration = context.getBean(DriverConfigLoader.class).getInitialConfig() .getDefaultProfile(); @@ -88,8 +88,8 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderWithContactPointAndNoPort() { this.contextRunner - .withPropertyValues("spring.data.cassandra.contact-points=cluster.example.com,another.example.com:9041", - "spring.data.cassandra.local-datacenter=cassandra-eu1") + .withPropertyValues("spring.cassandra.contact-points=cluster.example.com,another.example.com:9041", + "spring.cassandra.local-datacenter=cassandra-eu1") .run((context) -> { assertThat(context).hasSingleBean(DriverConfigLoader.class); DriverExecutionProfile configuration = context.getBean(DriverConfigLoader.class).getInitialConfig() @@ -104,8 +104,8 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderWithContactPointAndNoPortAndCustomPort() { this.contextRunner - .withPropertyValues("spring.data.cassandra.contact-points=cluster.example.com:9041,another.example.com", - "spring.data.cassandra.port=9043", "spring.data.cassandra.local-datacenter=cassandra-eu1") + .withPropertyValues("spring.cassandra.contact-points=cluster.example.com:9041,another.example.com", + "spring.cassandra.port=9043", "spring.cassandra.local-datacenter=cassandra-eu1") .run((context) -> { assertThat(context).hasSingleBean(DriverConfigLoader.class); DriverExecutionProfile configuration = context.getBean(DriverConfigLoader.class).getInitialConfig() @@ -119,7 +119,7 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderWithCustomSessionName() { - this.contextRunner.withPropertyValues("spring.data.cassandra.session-name=testcluster").run((context) -> { + this.contextRunner.withPropertyValues("spring.cassandra.session-name=testcluster").run((context) -> { assertThat(context).hasSingleBean(DriverConfigLoader.class); assertThat(context.getBean(DriverConfigLoader.class).getInitialConfig().getDefaultProfile() .getString(DefaultDriverOption.SESSION_NAME)).isEqualTo("testcluster"); @@ -129,7 +129,7 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderWithCustomSessionNameAndCustomizer() { this.contextRunner.withUserConfiguration(SimpleDriverConfigLoaderBuilderCustomizerConfig.class) - .withPropertyValues("spring.data.cassandra.session-name=testcluster").run((context) -> { + .withPropertyValues("spring.cassandra.session-name=testcluster").run((context) -> { assertThat(context).hasSingleBean(DriverConfigLoader.class); assertThat(context.getBean(DriverConfigLoader.class).getInitialConfig().getDefaultProfile() .getString(DefaultDriverOption.SESSION_NAME)).isEqualTo("overridden-name"); @@ -138,8 +138,8 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderCustomizeConnectionOptions() { - this.contextRunner.withPropertyValues("spring.data.cassandra.connection.connect-timeout=200ms", - "spring.data.cassandra.connection.init-query-timeout=10").run((context) -> { + this.contextRunner.withPropertyValues("spring.cassandra.connection.connect-timeout=200ms", + "spring.cassandra.connection.init-query-timeout=10").run((context) -> { DriverExecutionProfile config = context.getBean(DriverConfigLoader.class).getInitialConfig() .getDefaultProfile(); assertThat(config.getInt(DefaultDriverOption.CONNECTION_CONNECT_TIMEOUT)).isEqualTo(200); @@ -149,8 +149,8 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderCustomizePoolOptions() { - this.contextRunner.withPropertyValues("spring.data.cassandra.pool.idle-timeout=42", - "spring.data.cassandra.pool.heartbeat-interval=62").run((context) -> { + this.contextRunner.withPropertyValues("spring.cassandra.pool.idle-timeout=42", + "spring.cassandra.pool.heartbeat-interval=62").run((context) -> { DriverExecutionProfile config = context.getBean(DriverConfigLoader.class).getInitialConfig() .getDefaultProfile(); assertThat(config.getInt(DefaultDriverOption.HEARTBEAT_TIMEOUT)).isEqualTo(42); @@ -160,9 +160,9 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderCustomizeRequestOptions() { - this.contextRunner.withPropertyValues("spring.data.cassandra.request.timeout=5s", - "spring.data.cassandra.request.consistency=two", - "spring.data.cassandra.request.serial-consistency=quorum", "spring.data.cassandra.request.page-size=42") + this.contextRunner + .withPropertyValues("spring.cassandra.request.timeout=5s", "spring.cassandra.request.consistency=two", + "spring.cassandra.request.serial-consistency=quorum", "spring.cassandra.request.page-size=42") .run((context) -> { DriverExecutionProfile config = context.getBean(DriverConfigLoader.class).getInitialConfig() .getDefaultProfile(); @@ -175,12 +175,11 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderCustomizeControlConnectionOptions() { - this.contextRunner.withPropertyValues("spring.data.cassandra.controlconnection.timeout=200ms") - .run((context) -> { - DriverExecutionProfile config = context.getBean(DriverConfigLoader.class).getInitialConfig() - .getDefaultProfile(); - assertThat(config.getInt(DefaultDriverOption.CONTROL_CONNECTION_TIMEOUT)).isEqualTo(200); - }); + this.contextRunner.withPropertyValues("spring.cassandra.controlconnection.timeout=200ms").run((context) -> { + DriverExecutionProfile config = context.getBean(DriverConfigLoader.class).getInitialConfig() + .getDefaultProfile(); + assertThat(config.getInt(DefaultDriverOption.CONTROL_CONNECTION_TIMEOUT)).isEqualTo(200); + }); } @Test @@ -195,7 +194,7 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderWithRateLimitingRequiresExtraConfiguration() { - this.contextRunner.withPropertyValues("spring.data.cassandra.request.throttler.type=rate-limiting") + this.contextRunner.withPropertyValues("spring.cassandra.request.throttler.type=rate-limiting") .run((context) -> assertThatThrownBy(() -> context.getBean(CqlSession.class)) .hasMessageContaining("Error instantiating class RateLimitingRequestThrottler") .hasMessageContaining("No configuration setting found for key")); @@ -203,9 +202,9 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderCustomizeConcurrencyLimitingRequestThrottler() { - this.contextRunner.withPropertyValues("spring.data.cassandra.request.throttler.type=concurrency-limiting", - "spring.data.cassandra.request.throttler.max-concurrent-requests=62", - "spring.data.cassandra.request.throttler.max-queue-size=72").run((context) -> { + this.contextRunner.withPropertyValues("spring.cassandra.request.throttler.type=concurrency-limiting", + "spring.cassandra.request.throttler.max-concurrent-requests=62", + "spring.cassandra.request.throttler.max-queue-size=72").run((context) -> { DriverExecutionProfile config = context.getBean(DriverConfigLoader.class).getInitialConfig() .getDefaultProfile(); assertThat(config.getString(DefaultDriverOption.REQUEST_THROTTLER_CLASS)) @@ -218,10 +217,10 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderCustomizeRateLimitingRequestThrottler() { - this.contextRunner.withPropertyValues("spring.data.cassandra.request.throttler.type=rate-limiting", - "spring.data.cassandra.request.throttler.max-requests-per-second=62", - "spring.data.cassandra.request.throttler.max-queue-size=72", - "spring.data.cassandra.request.throttler.drain-interval=16ms").run((context) -> { + this.contextRunner.withPropertyValues("spring.cassandra.request.throttler.type=rate-limiting", + "spring.cassandra.request.throttler.max-requests-per-second=62", + "spring.cassandra.request.throttler.max-queue-size=72", + "spring.cassandra.request.throttler.drain-interval=16ms").run((context) -> { DriverExecutionProfile config = context.getBean(DriverConfigLoader.class).getInitialConfig() .getDefaultProfile(); assertThat(config.getString(DefaultDriverOption.REQUEST_THROTTLER_CLASS)) @@ -236,8 +235,8 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderWithConfigComplementSettings() { String configLocation = "org/springframework/boot/autoconfigure/cassandra/simple.conf"; - this.contextRunner.withPropertyValues("spring.data.cassandra.session-name=testcluster", - "spring.data.cassandra.config=" + configLocation).run((context) -> { + this.contextRunner.withPropertyValues("spring.cassandra.session-name=testcluster", + "spring.cassandra.config=" + configLocation).run((context) -> { assertThat(context).hasSingleBean(DriverConfigLoader.class); assertThat(context.getBean(DriverConfigLoader.class).getInitialConfig().getDefaultProfile() .getString(DefaultDriverOption.SESSION_NAME)).isEqualTo("testcluster"); @@ -249,7 +248,7 @@ class CassandraAutoConfigurationTests { @Test // gh-31238 void driverConfigLoaderWithConfigOverridesDefaults() { String configLocation = "org/springframework/boot/autoconfigure/cassandra/override-defaults.conf"; - this.contextRunner.withPropertyValues("spring.data.cassandra.config=" + configLocation).run((context) -> { + this.contextRunner.withPropertyValues("spring.cassandra.config=" + configLocation).run((context) -> { DriverExecutionProfile actual = context.getBean(DriverConfigLoader.class).getInitialConfig() .getDefaultProfile(); assertThat(actual.getString(DefaultDriverOption.SESSION_NAME)).isEqualTo("advanced session"); @@ -271,7 +270,7 @@ class CassandraAutoConfigurationTests { @Test void driverConfigLoaderWithConfigCreateProfiles() { String configLocation = "org/springframework/boot/autoconfigure/cassandra/profiles.conf"; - this.contextRunner.withPropertyValues("spring.data.cassandra.config=" + configLocation).run((context) -> { + this.contextRunner.withPropertyValues("spring.cassandra.config=" + configLocation).run((context) -> { assertThat(context).hasSingleBean(DriverConfigLoader.class); DriverConfig driverConfig = context.getBean(DriverConfigLoader.class).getInitialConfig(); assertThat(driverConfig.getProfiles()).containsOnlyKeys("default", "first", "second"); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationWithPasswordAuthenticationIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationWithPasswordAuthenticationIntegrationTests.java index 84baa16093..46b4524ce8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationWithPasswordAuthenticationIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationWithPasswordAuthenticationIntegrationTests.java @@ -56,17 +56,15 @@ class CassandraAutoConfigurationWithPasswordAuthenticationIntegrationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(CassandraAutoConfiguration.class)).withPropertyValues( - "spring.data.cassandra.contact-points:" + cassandra.getHost() + ":" - + cassandra.getFirstMappedPort(), - "spring.data.cassandra.local-datacenter=datacenter1", - "spring.data.cassandra.connection.connect-timeout=60s", - "spring.data.cassandra.connection.init-query-timeout=60s", - "spring.data.cassandra.request.timeout=60s"); + "spring.cassandra.contact-points:" + cassandra.getHost() + ":" + cassandra.getFirstMappedPort(), + "spring.cassandra.local-datacenter=datacenter1", "spring.cassandra.connection.connect-timeout=60s", + "spring.cassandra.connection.init-query-timeout=60s", "spring.cassandra.request.timeout=60s"); @Test void authenticationWithValidUsernameAndPassword() { - this.contextRunner.withPropertyValues("spring.data.cassandra.username=cassandra", - "spring.data.cassandra.password=cassandra").run((context) -> { + this.contextRunner + .withPropertyValues("spring.cassandra.username=cassandra", "spring.cassandra.password=cassandra") + .run((context) -> { SimpleStatement select = SimpleStatement.newInstance("SELECT release_version FROM system.local") .setConsistencyLevel(ConsistencyLevel.LOCAL_ONE); assertThat(context.getBean(CqlSession.class).execute(select).one()).isNotNull(); @@ -76,8 +74,8 @@ class CassandraAutoConfigurationWithPasswordAuthenticationIntegrationTests { @Test void authenticationWithInvalidCredentials() { this.contextRunner - .withPropertyValues("spring.data.cassandra.username=not-a-user", - "spring.data.cassandra.password=invalid-password") + .withPropertyValues("spring.cassandra.username=not-a-user", + "spring.cassandra.password=invalid-password") .run((context) -> assertThatThrownBy(() -> context.getBean(CqlSession.class)) .hasMessageContaining("Authentication error")); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraPropertiesTests.java index abb2e6fb9e..3096ffc49e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraPropertiesTests.java @@ -40,21 +40,21 @@ class CassandraPropertiesTests { @Test void defaultValuesInManualMetadataAreConsistent() { OptionsMap driverDefaults = OptionsMap.driverDefaults(); - // spring.data.cassandra.connection.connect-timeout + // spring.cassandra.connection.connect-timeout assertThat(driverDefaults.get(TypedDriverOption.CONNECTION_CONNECT_TIMEOUT)).isEqualTo(Duration.ofSeconds(5)); - // spring.data.cassandra.connection.init-query-timeout + // spring.cassandra.connection.init-query-timeout assertThat(driverDefaults.get(TypedDriverOption.CONNECTION_INIT_QUERY_TIMEOUT)) .isEqualTo(Duration.ofSeconds(5)); - // spring.data.cassandra.request.timeout + // spring.cassandra.request.timeout assertThat(driverDefaults.get(TypedDriverOption.REQUEST_TIMEOUT)).isEqualTo(Duration.ofSeconds(2)); - // spring.data.cassandra.request.page-size + // spring.cassandra.request.page-size assertThat(driverDefaults.get(TypedDriverOption.REQUEST_PAGE_SIZE)).isEqualTo(5000); - // spring.data.cassandra.request.throttler.type + // spring.cassandra.request.throttler.type assertThat(driverDefaults.get(TypedDriverOption.REQUEST_THROTTLER_CLASS)) .isEqualTo("PassThroughRequestThrottler"); // "none" - // spring.data.cassandra.pool.heartbeat-interval + // spring.cassandra.pool.heartbeat-interval assertThat(driverDefaults.get(TypedDriverOption.HEARTBEAT_INTERVAL)).isEqualTo(Duration.ofSeconds(30)); - // spring.data.cassandra.pool.idle-timeout + // spring.cassandra.pool.idle-timeout assertThat(driverDefaults.get(TypedDriverOption.HEARTBEAT_TIMEOUT)).isEqualTo(Duration.ofSeconds(5)); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationIntegrationTests.java index 80392014d1..51ffd85d4b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationIntegrationTests.java @@ -52,12 +52,9 @@ class CassandraDataAutoConfigurationIntegrationTests { .withConfiguration( AutoConfigurations.of(CassandraAutoConfiguration.class, CassandraDataAutoConfiguration.class)) .withPropertyValues( - "spring.data.cassandra.contact-points:" + cassandra.getHost() + ":" - + cassandra.getFirstMappedPort(), - "spring.data.cassandra.local-datacenter=datacenter1", - "spring.data.cassandra.connection.connect-timeout=60s", - "spring.data.cassandra.connection.init-query-timeout=60s", - "spring.data.cassandra.request.timeout=60s") + "spring.cassandra.contact-points:" + cassandra.getHost() + ":" + cassandra.getFirstMappedPort(), + "spring.cassandra.local-datacenter=datacenter1", "spring.cassandra.connection.connect-timeout=60s", + "spring.cassandra.connection.init-query-timeout=60s", "spring.cassandra.request.timeout=60s") .withInitializer((context) -> AutoConfigurationPackages.register((BeanDefinitionRegistry) context, City.class.getPackage().getName())); @@ -70,7 +67,7 @@ class CassandraDataAutoConfigurationIntegrationTests { @Test void hasRecreateSchemaActionSet() { this.contextRunner.withUserConfiguration(KeyspaceTestConfiguration.class) - .withPropertyValues("spring.data.cassandra.schemaAction=recreate_drop_unused") + .withPropertyValues("spring.cassandra.schemaAction=recreate_drop_unused") .run((context) -> assertThat(context.getBean(SessionFactoryFactoryBean.class)) .hasFieldOrPropertyWithValue("schemaAction", SchemaAction.RECREATE_DROP_UNUSED)); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java index f43d3e4fbf..b5ab262e38 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java @@ -110,7 +110,7 @@ class CassandraDataAutoConfigurationTests { void load(Class... config) { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); - TestPropertyValues.of("spring.data.cassandra.keyspaceName:boot_test").applyTo(ctx); + TestPropertyValues.of("spring.cassandra.keyspaceName:boot_test").applyTo(ctx); if (!ObjectUtils.isEmpty(config)) { ctx.register(config); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveDataAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveDataAutoConfigurationTests.java index d689f9158a..5e0521c650 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveDataAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraReactiveDataAutoConfigurationTests.java @@ -54,13 +54,13 @@ class CassandraReactiveDataAutoConfigurationTests { @Test void templateExists() { - load("spring.data.cassandra.keyspaceName:boot_test"); + load("spring.cassandra.keyspaceName:boot_test"); assertThat(this.context.getBeanNamesForType(ReactiveCassandraTemplate.class)).hasSize(1); } @Test void entityScanShouldSetManagedTypes() { - load(EntityScanConfig.class, "spring.data.cassandra.keyspaceName:boot_test"); + load(EntityScanConfig.class, "spring.cassandra.keyspaceName:boot_test"); CassandraMappingContext mappingContext = this.context.getBean(CassandraMappingContext.class); ManagedTypes managedTypes = (ManagedTypes) ReflectionTestUtils.getField(mappingContext, "managedTypes"); assertThat(managedTypes.toList()).containsOnly(City.class); @@ -68,7 +68,7 @@ class CassandraReactiveDataAutoConfigurationTests { @Test void userTypeResolverShouldBeSet() { - load("spring.data.cassandra.keyspaceName:boot_test"); + load("spring.cassandra.keyspaceName:boot_test"); CassandraConverter cassandraConverter = this.context.getBean(CassandraConverter.class); assertThat(cassandraConverter).extracting("userTypeResolver").isInstanceOf(SimpleUserTypeResolver.class); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesAutoConfigurationTests.java index 6d2f1bc9ab..5190db7e02 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesAutoConfigurationTests.java @@ -79,14 +79,14 @@ class CassandraRepositoriesAutoConfigurationTests { @Test void enablingReactiveRepositoriesDisablesImperativeRepositories() { this.contextRunner.withUserConfiguration(DefaultConfiguration.class) - .withPropertyValues("spring.data.cassandra.repositories.type=reactive") + .withPropertyValues("spring.cassandra.repositories.type=reactive") .run((context) -> assertThat(context).doesNotHaveBean(CityCassandraRepository.class)); } @Test void enablingNoRepositoriesDisablesImperativeRepositories() { this.contextRunner.withUserConfiguration(DefaultConfiguration.class) - .withPropertyValues("spring.data.cassandra.repositories.type=none") + .withPropertyValues("spring.cassandra.repositories.type=none") .run((context) -> assertThat(context).doesNotHaveBean(CityCassandraRepository.class)); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationJedisTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationJedisTests.java index dec8ee50a0..3211ab5273 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationJedisTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationJedisTests.java @@ -54,20 +54,21 @@ class RedisAutoConfigurationJedisTests { @Test void connectionFactoryIsNotCreatedWhenLettuceIsSelected() { - this.contextRunner.withPropertyValues("spring.redis.client-type=lettuce") + this.contextRunner.withPropertyValues("spring.data.redis.client-type=lettuce") .run((context) -> assertThat(context).doesNotHaveBean(RedisConnectionFactory.class)); } @Test void testOverrideRedisConfiguration() { - this.contextRunner.withPropertyValues("spring.redis.host:foo", "spring.redis.database:1").run((context) -> { - JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class); - assertThat(cf.getHostName()).isEqualTo("foo"); - assertThat(cf.getDatabase()).isEqualTo(1); - assertThat(getUserName(cf)).isNull(); - assertThat(cf.getPassword()).isNull(); - assertThat(cf.isUseSsl()).isFalse(); - }); + this.contextRunner.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.database:1") + .run((context) -> { + JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class); + assertThat(cf.getHostName()).isEqualTo("foo"); + assertThat(cf.getDatabase()).isEqualTo(1); + assertThat(getUserName(cf)).isNull(); + assertThat(cf.getPassword()).isNull(); + assertThat(cf.isUseSsl()).isFalse(); + }); } @Test @@ -80,9 +81,8 @@ class RedisAutoConfigurationJedisTests { @Test void testRedisUrlConfiguration() { - this.contextRunner - .withPropertyValues("spring.redis.host:foo", "spring.redis.url:redis://user:password@example:33") - .run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo", + "spring.data.redis.url:redis://user:password@example:33").run((context) -> { JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("example"); assertThat(cf.getPort()).isEqualTo(33); @@ -94,10 +94,9 @@ class RedisAutoConfigurationJedisTests { @Test void testOverrideUrlRedisConfiguration() { - this.contextRunner - .withPropertyValues("spring.redis.host:foo", "spring.redis.password:xyz", "spring.redis.port:1000", - "spring.redis.ssl:false", "spring.redis.url:rediss://user:password@example:33") - .run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.password:xyz", + "spring.data.redis.port:1000", "spring.data.redis.ssl:false", + "spring.data.redis.url:rediss://user:password@example:33").run((context) -> { JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("example"); assertThat(cf.getPort()).isEqualTo(33); @@ -109,7 +108,7 @@ class RedisAutoConfigurationJedisTests { @Test void testPasswordInUrlWithColon() { - this.contextRunner.withPropertyValues("spring.redis.url:redis://:pass:word@example:33").run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.url:redis://:pass:word@example:33").run((context) -> { JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("example"); assertThat(cf.getPort()).isEqualTo(33); @@ -120,21 +119,22 @@ class RedisAutoConfigurationJedisTests { @Test void testPasswordInUrlStartsWithColon() { - this.contextRunner.withPropertyValues("spring.redis.url:redis://user::pass:word@example:33").run((context) -> { - JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class); - assertThat(cf.getHostName()).isEqualTo("example"); - assertThat(cf.getPort()).isEqualTo(33); - assertThat(getUserName(cf)).isEqualTo("user"); - assertThat(cf.getPassword()).isEqualTo(":pass:word"); - }); + this.contextRunner.withPropertyValues("spring.data.redis.url:redis://user::pass:word@example:33") + .run((context) -> { + JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class); + assertThat(cf.getHostName()).isEqualTo("example"); + assertThat(cf.getPort()).isEqualTo(33); + assertThat(getUserName(cf)).isEqualTo("user"); + assertThat(cf.getPassword()).isEqualTo(":pass:word"); + }); } @Test void testRedisConfigurationWithPool() { - this.contextRunner.withPropertyValues("spring.redis.host:foo", "spring.redis.jedis.pool.min-idle:1", - "spring.redis.jedis.pool.max-idle:4", "spring.redis.jedis.pool.max-active:16", - "spring.redis.jedis.pool.max-wait:2000", "spring.redis.jedis.pool.time-between-eviction-runs:30000") - .run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.jedis.pool.min-idle:1", + "spring.data.redis.jedis.pool.max-idle:4", "spring.data.redis.jedis.pool.max-active:16", + "spring.data.redis.jedis.pool.max-wait:2000", + "spring.data.redis.jedis.pool.time-between-eviction-runs:30000").run((context) -> { JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); assertThat(cf.getPoolConfig().getMinIdle()).isEqualTo(1); @@ -147,7 +147,8 @@ class RedisAutoConfigurationJedisTests { @Test void testRedisConfigurationDisabledPool() { - this.contextRunner.withPropertyValues("spring.redis.host:foo", "spring.redis.jedis.pool.enabled:false") + this.contextRunner + .withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.jedis.pool.enabled:false") .run((context) -> { JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); @@ -157,8 +158,8 @@ class RedisAutoConfigurationJedisTests { @Test void testRedisConfigurationWithTimeoutAndConnectTimeout() { - this.contextRunner.withPropertyValues("spring.redis.host:foo", "spring.redis.timeout:250", - "spring.redis.connect-timeout:1000").run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.timeout:250", + "spring.data.redis.connect-timeout:1000").run((context) -> { JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); assertThat(cf.getTimeout()).isEqualTo(250); @@ -168,7 +169,7 @@ class RedisAutoConfigurationJedisTests { @Test void testRedisConfigurationWithDefaultTimeouts() { - this.contextRunner.withPropertyValues("spring.redis.host:foo").run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo").run((context) -> { JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); assertThat(cf.getTimeout()).isEqualTo(2000); @@ -178,7 +179,7 @@ class RedisAutoConfigurationJedisTests { @Test void testRedisConfigurationWithClientName() { - this.contextRunner.withPropertyValues("spring.redis.host:foo", "spring.redis.client-name:spring-boot") + this.contextRunner.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.client-name:spring-boot") .run((context) -> { JedisConnectionFactory cf = context.getBean(JedisConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); @@ -189,8 +190,8 @@ class RedisAutoConfigurationJedisTests { @Test void testRedisConfigurationWithSentinel() { this.contextRunner - .withPropertyValues("spring.redis.sentinel.master:mymaster", - "spring.redis.sentinel.nodes:127.0.0.1:26379,127.0.0.1:26380") + .withPropertyValues("spring.data.redis.sentinel.master:mymaster", + "spring.data.redis.sentinel.nodes:127.0.0.1:26379,127.0.0.1:26380") .withUserConfiguration(JedisConnectionFactoryCaptorConfiguration.class) .run((context) -> assertThat(JedisConnectionFactoryCaptor.connectionFactory.isRedisSentinelAware()) .isTrue()); @@ -198,8 +199,10 @@ class RedisAutoConfigurationJedisTests { @Test void testRedisConfigurationWithSentinelAndAuthentication() { - this.contextRunner.withPropertyValues("spring.redis.username=user", "spring.redis.password=password", - "spring.redis.sentinel.master:mymaster", "spring.redis.sentinel.nodes:127.0.0.1:26379,127.0.0.1:26380") + this.contextRunner + .withPropertyValues("spring.data.redis.username=user", "spring.data.redis.password=password", + "spring.data.redis.sentinel.master:mymaster", + "spring.data.redis.sentinel.nodes:127.0.0.1:26379,127.0.0.1:26380") .withUserConfiguration(JedisConnectionFactoryCaptorConfiguration.class).run((context) -> { assertThat(JedisConnectionFactoryCaptor.connectionFactory.isRedisSentinelAware()).isTrue(); assertThat(getUserName(JedisConnectionFactoryCaptor.connectionFactory)).isEqualTo("user"); @@ -209,7 +212,7 @@ class RedisAutoConfigurationJedisTests { @Test void testRedisConfigurationWithCluster() { - this.contextRunner.withPropertyValues("spring.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380") + this.contextRunner.withPropertyValues("spring.data.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380") .withUserConfiguration(JedisConnectionFactoryCaptorConfiguration.class) .run((context) -> assertThat(JedisConnectionFactoryCaptor.connectionFactory.isRedisClusterAware()) .isTrue()); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationLettuceWithoutCommonsPool2Tests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationLettuceWithoutCommonsPool2Tests.java index 0471a72dde..6a10823917 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationLettuceWithoutCommonsPool2Tests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationLettuceWithoutCommonsPool2Tests.java @@ -39,7 +39,7 @@ class RedisAutoConfigurationLettuceWithoutCommonsPool2Tests { @Test void poolWithoutCommonsPool2IsDisabledByDefault() { - this.contextRunner.withPropertyValues("spring.redis.host:foo").run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo").run((context) -> { LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); assertThat(cf.getClientConfiguration()).isNotInstanceOf(LettucePoolingClientConfiguration.class); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationTests.java index d2547a75a8..c724b48676 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisAutoConfigurationTests.java @@ -90,8 +90,8 @@ class RedisAutoConfigurationTests { @Test void testOverrideRedisConfiguration() { - this.contextRunner.withPropertyValues("spring.redis.host:foo", "spring.redis.database:1", - "spring.redis.lettuce.shutdown-timeout:500").run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.database:1", + "spring.data.redis.lettuce.shutdown-timeout:500").run((context) -> { LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); assertThat(cf.getDatabase()).isEqualTo(1); @@ -122,9 +122,8 @@ class RedisAutoConfigurationTests { @Test void testRedisUrlConfiguration() { - this.contextRunner - .withPropertyValues("spring.redis.host:foo", "spring.redis.url:redis://user:password@example:33") - .run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo", + "spring.data.redis.url:redis://user:password@example:33").run((context) -> { LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("example"); assertThat(cf.getPort()).isEqualTo(33); @@ -136,10 +135,9 @@ class RedisAutoConfigurationTests { @Test void testOverrideUrlRedisConfiguration() { - this.contextRunner - .withPropertyValues("spring.redis.host:foo", "spring.redis.password:xyz", "spring.redis.port:1000", - "spring.redis.ssl:false", "spring.redis.url:rediss://user:password@example:33") - .run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.password:xyz", + "spring.data.redis.port:1000", "spring.data.redis.ssl:false", + "spring.data.redis.url:rediss://user:password@example:33").run((context) -> { LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("example"); assertThat(cf.getPort()).isEqualTo(33); @@ -151,7 +149,7 @@ class RedisAutoConfigurationTests { @Test void testPasswordInUrlWithColon() { - this.contextRunner.withPropertyValues("spring.redis.url:redis://:pass:word@example:33").run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.url:redis://:pass:word@example:33").run((context) -> { LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("example"); assertThat(cf.getPort()).isEqualTo(33); @@ -162,19 +160,20 @@ class RedisAutoConfigurationTests { @Test void testPasswordInUrlStartsWithColon() { - this.contextRunner.withPropertyValues("spring.redis.url:redis://user::pass:word@example:33").run((context) -> { - LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); - assertThat(cf.getHostName()).isEqualTo("example"); - assertThat(cf.getPort()).isEqualTo(33); - assertThat(getUserName(cf)).isEqualTo("user"); - assertThat(cf.getPassword()).isEqualTo(":pass:word"); - }); + this.contextRunner.withPropertyValues("spring.data.redis.url:redis://user::pass:word@example:33") + .run((context) -> { + LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); + assertThat(cf.getHostName()).isEqualTo("example"); + assertThat(cf.getPort()).isEqualTo(33); + assertThat(getUserName(cf)).isEqualTo("user"); + assertThat(cf.getPassword()).isEqualTo(":pass:word"); + }); } @Test void testRedisConfigurationUsePoolByDefault() { Pool defaultPool = new RedisProperties().getLettuce().getPool(); - this.contextRunner.withPropertyValues("spring.redis.host:foo").run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo").run((context) -> { LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); GenericObjectPoolConfig poolConfig = getPoolingClientConfiguration(cf).getPoolConfig(); @@ -187,10 +186,11 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithCustomPoolSettings() { - this.contextRunner.withPropertyValues("spring.redis.host:foo", "spring.redis.lettuce.pool.min-idle:1", - "spring.redis.lettuce.pool.max-idle:4", "spring.redis.lettuce.pool.max-active:16", - "spring.redis.lettuce.pool.max-wait:2000", "spring.redis.lettuce.pool.time-between-eviction-runs:30000", - "spring.redis.lettuce.shutdown-timeout:1000").run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.lettuce.pool.min-idle:1", + "spring.data.redis.lettuce.pool.max-idle:4", "spring.data.redis.lettuce.pool.max-active:16", + "spring.data.redis.lettuce.pool.max-wait:2000", + "spring.data.redis.lettuce.pool.time-between-eviction-runs:30000", + "spring.data.redis.lettuce.shutdown-timeout:1000").run((context) -> { LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); GenericObjectPoolConfig poolConfig = getPoolingClientConfiguration(cf).getPoolConfig(); @@ -205,7 +205,8 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationDisabledPool() { - this.contextRunner.withPropertyValues("spring.redis.host:foo", "spring.redis.lettuce.pool.enabled:false") + this.contextRunner + .withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.lettuce.pool.enabled:false") .run((context) -> { LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); @@ -215,8 +216,8 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithTimeoutAndConnectTimeout() { - this.contextRunner.withPropertyValues("spring.redis.host:foo", "spring.redis.timeout:250", - "spring.redis.connect-timeout:1000").run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.timeout:250", + "spring.data.redis.connect-timeout:1000").run((context) -> { LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); assertThat(cf.getTimeout()).isEqualTo(250); @@ -227,7 +228,7 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithDefaultTimeouts() { - this.contextRunner.withPropertyValues("spring.redis.host:foo").run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.host:foo").run((context) -> { LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); assertThat(cf.getTimeout()).isEqualTo(60000); @@ -246,7 +247,7 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithClientName() { - this.contextRunner.withPropertyValues("spring.redis.host:foo", "spring.redis.client-name:spring-boot") + this.contextRunner.withPropertyValues("spring.data.redis.host:foo", "spring.data.redis.client-name:spring-boot") .run((context) -> { LettuceConnectionFactory cf = context.getBean(LettuceConnectionFactory.class); assertThat(cf.getHostName()).isEqualTo("foo"); @@ -256,7 +257,7 @@ class RedisAutoConfigurationTests { @Test void connectionFactoryWithJedisClientType() { - this.contextRunner.withPropertyValues("spring.redis.client-type:jedis").run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.client-type:jedis").run((context) -> { assertThat(context).hasSingleBean(RedisConnectionFactory.class); assertThat(context.getBean(RedisConnectionFactory.class)).isInstanceOf(JedisConnectionFactory.class); }); @@ -264,7 +265,7 @@ class RedisAutoConfigurationTests { @Test void connectionFactoryWithLettuceClientType() { - this.contextRunner.withPropertyValues("spring.redis.client-type:lettuce").run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.client-type:lettuce").run((context) -> { assertThat(context).hasSingleBean(RedisConnectionFactory.class); assertThat(context.getBean(RedisConnectionFactory.class)).isInstanceOf(LettuceConnectionFactory.class); }); @@ -274,16 +275,18 @@ class RedisAutoConfigurationTests { void testRedisConfigurationWithSentinel() { List sentinels = Arrays.asList("127.0.0.1:26379", "127.0.0.1:26380"); this.contextRunner - .withPropertyValues("spring.redis.sentinel.master:mymaster", - "spring.redis.sentinel.nodes:" + StringUtils.collectionToCommaDelimitedString(sentinels)) + .withPropertyValues("spring.data.redis.sentinel.master:mymaster", + "spring.data.redis.sentinel.nodes:" + StringUtils.collectionToCommaDelimitedString(sentinels)) .run((context) -> assertThat(context.getBean(LettuceConnectionFactory.class).isRedisSentinelAware()) .isTrue()); } @Test void testRedisConfigurationWithSentinelAndDatabase() { - this.contextRunner.withPropertyValues("spring.redis.database:1", "spring.redis.sentinel.master:mymaster", - "spring.redis.sentinel.nodes:127.0.0.1:26379, 127.0.0.1:26380").run((context) -> { + this.contextRunner + .withPropertyValues("spring.data.redis.database:1", "spring.data.redis.sentinel.master:mymaster", + "spring.data.redis.sentinel.nodes:127.0.0.1:26379, 127.0.0.1:26380") + .run((context) -> { LettuceConnectionFactory connectionFactory = context.getBean(LettuceConnectionFactory.class); assertThat(connectionFactory.getDatabase()).isEqualTo(1); assertThat(connectionFactory.isRedisSentinelAware()).isTrue(); @@ -293,9 +296,9 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithSentinelAndAuthentication() { this.contextRunner - .withPropertyValues("spring.redis.username=user", "spring.redis.password=password", - "spring.redis.sentinel.master:mymaster", - "spring.redis.sentinel.nodes:127.0.0.1:26379, 127.0.0.1:26380") + .withPropertyValues("spring.data.redis.username=user", "spring.data.redis.password=password", + "spring.data.redis.sentinel.master:mymaster", + "spring.data.redis.sentinel.nodes:127.0.0.1:26379, 127.0.0.1:26380") .run(assertSentinelConfiguration("user", "password", (sentinelConfiguration) -> { assertThat(sentinelConfiguration.getSentinelPassword().isPresent()).isFalse(); Set sentinels = sentinelConfiguration.getSentinels(); @@ -307,9 +310,9 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithSentinelPasswordAndDataNodePassword() { this.contextRunner - .withPropertyValues("spring.redis.password=password", "spring.redis.sentinel.password=secret", - "spring.redis.sentinel.master:mymaster", - "spring.redis.sentinel.nodes:127.0.0.1:26379, 127.0.0.1:26380") + .withPropertyValues("spring.data.redis.password=password", "spring.data.redis.sentinel.password=secret", + "spring.data.redis.sentinel.master:mymaster", + "spring.data.redis.sentinel.nodes:127.0.0.1:26379, 127.0.0.1:26380") .run(assertSentinelConfiguration(null, "password", (sentinelConfiguration) -> { assertThat(sentinelConfiguration.getSentinelUsername()).isNull(); assertThat(new String(sentinelConfiguration.getSentinelPassword().get())).isEqualTo("secret"); @@ -322,10 +325,10 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithSentinelAuthenticationAndDataNodeAuthentication() { this.contextRunner - .withPropertyValues("spring.redis.username=username", "spring.redis.password=password", - "spring.redis.sentinel.username=sentinel", "spring.redis.sentinel.password=secret", - "spring.redis.sentinel.master:mymaster", - "spring.redis.sentinel.nodes:127.0.0.1:26379, 127.0.0.1:26380") + .withPropertyValues("spring.data.redis.username=username", "spring.data.redis.password=password", + "spring.data.redis.sentinel.username=sentinel", "spring.data.redis.sentinel.password=secret", + "spring.data.redis.sentinel.master:mymaster", + "spring.data.redis.sentinel.nodes:127.0.0.1:26379, 127.0.0.1:26380") .run(assertSentinelConfiguration("username", "password", (sentinelConfiguration) -> { assertThat(sentinelConfiguration.getSentinelUsername()).isEqualTo("sentinel"); assertThat(new String(sentinelConfiguration.getSentinelPassword().get())).isEqualTo("secret"); @@ -347,9 +350,8 @@ class RedisAutoConfigurationTests { @Test void testRedisSentinelUrlConfiguration() { - this.contextRunner - .withPropertyValues( - "spring.redis.url=redis-sentinel://username:password@127.0.0.1:26379,127.0.0.1:26380/mymaster") + this.contextRunner.withPropertyValues( + "spring.data.redis.url=redis-sentinel://username:password@127.0.0.1:26379,127.0.0.1:26380/mymaster") .run((context) -> assertThatIllegalStateException() .isThrownBy(() -> context.getBean(LettuceConnectionFactory.class)) .withRootCauseInstanceOf(RedisUrlSyntaxException.class).havingRootCause().withMessageContaining( @@ -359,8 +361,8 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithCluster() { List clusterNodes = Arrays.asList("127.0.0.1:27379", "127.0.0.1:27380"); - this.contextRunner.withPropertyValues("spring.redis.cluster.nodes[0]:" + clusterNodes.get(0), - "spring.redis.cluster.nodes[1]:" + clusterNodes.get(1)).run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.cluster.nodes[0]:" + clusterNodes.get(0), + "spring.data.redis.cluster.nodes[1]:" + clusterNodes.get(1)).run((context) -> { RedisClusterConfiguration clusterConfiguration = context.getBean(LettuceConnectionFactory.class) .getClusterConfiguration(); assertThat(clusterConfiguration.getClusterNodes()).hasSize(2); @@ -374,9 +376,9 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithClusterAndAuthentication() { List clusterNodes = Arrays.asList("127.0.0.1:27379", "127.0.0.1:27380"); - this.contextRunner.withPropertyValues("spring.redis.username=user", "spring.redis.password=password", - "spring.redis.cluster.nodes[0]:" + clusterNodes.get(0), - "spring.redis.cluster.nodes[1]:" + clusterNodes.get(1)).run((context) -> { + this.contextRunner.withPropertyValues("spring.data.redis.username=user", "spring.data.redis.password=password", + "spring.data.redis.cluster.nodes[0]:" + clusterNodes.get(0), + "spring.data.redis.cluster.nodes[1]:" + clusterNodes.get(1)).run((context) -> { LettuceConnectionFactory connectionFactory = context.getBean(LettuceConnectionFactory.class); assertThat(getUserName(connectionFactory)).isEqualTo("user"); assertThat(connectionFactory.getPassword()).isEqualTo("password"); @@ -395,7 +397,7 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithClusterCreateClusterClientOptions() { - this.contextRunner.withPropertyValues("spring.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380") + this.contextRunner.withPropertyValues("spring.data.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380") .run(assertClientOptions(ClusterClientOptions.class, (options) -> { assertThat(options.getTimeoutOptions().isApplyConnectionTimeout()).isTrue(); assertThat(options.getTimeoutOptions().isTimeoutCommands()).isTrue(); @@ -405,8 +407,8 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithClusterRefreshPeriod() { this.contextRunner - .withPropertyValues("spring.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380", - "spring.redis.lettuce.cluster.refresh.period=30s") + .withPropertyValues("spring.data.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380", + "spring.data.redis.lettuce.cluster.refresh.period=30s") .run(assertClientOptions(ClusterClientOptions.class, (options) -> assertThat(options.getTopologyRefreshOptions().getRefreshPeriod()) .hasSeconds(30))); @@ -415,8 +417,8 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithClusterAdaptiveRefresh() { this.contextRunner - .withPropertyValues("spring.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380", - "spring.redis.lettuce.cluster.refresh.adaptive=true") + .withPropertyValues("spring.data.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380", + "spring.data.redis.lettuce.cluster.refresh.adaptive=true") .run(assertClientOptions(ClusterClientOptions.class, (options) -> assertThat(options.getTopologyRefreshOptions().getAdaptiveRefreshTriggers()) .isEqualTo(EnumSet.allOf(RefreshTrigger.class)))); @@ -424,15 +426,15 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithClusterRefreshPeriodHasNoEffectWithNonClusteredConfiguration() { - this.contextRunner.withPropertyValues("spring.redis.cluster.refresh.period=30s").run(assertClientOptions( + this.contextRunner.withPropertyValues("spring.data.redis.cluster.refresh.period=30s").run(assertClientOptions( ClientOptions.class, (options) -> assertThat(options.getClass()).isEqualTo(ClientOptions.class))); } @Test void testRedisConfigurationWithClusterDynamicRefreshSourcesEnabled() { this.contextRunner - .withPropertyValues("spring.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380", - "spring.redis.lettuce.cluster.refresh.dynamic-refresh-sources=true") + .withPropertyValues("spring.data.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380", + "spring.data.redis.lettuce.cluster.refresh.dynamic-refresh-sources=true") .run(assertClientOptions(ClusterClientOptions.class, (options) -> assertThat(options.getTopologyRefreshOptions().useDynamicRefreshSources()) .isTrue())); @@ -441,8 +443,8 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithClusterDynamicRefreshSourcesDisabled() { this.contextRunner - .withPropertyValues("spring.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380", - "spring.redis.lettuce.cluster.refresh.dynamic-refresh-sources=false") + .withPropertyValues("spring.data.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380", + "spring.data.redis.lettuce.cluster.refresh.dynamic-refresh-sources=false") .run(assertClientOptions(ClusterClientOptions.class, (options) -> assertThat(options.getTopologyRefreshOptions().useDynamicRefreshSources()) .isFalse())); @@ -451,8 +453,8 @@ class RedisAutoConfigurationTests { @Test void testRedisConfigurationWithClusterDynamicSourcesUnspecifiedUsesDefault() { this.contextRunner - .withPropertyValues("spring.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380", - "spring.redis.lettuce.cluster.refresh.dynamic-sources=") + .withPropertyValues("spring.data.redis.cluster.nodes=127.0.0.1:27379,127.0.0.1:27380", + "spring.data.redis.lettuce.cluster.refresh.dynamic-sources=") .run(assertClientOptions(ClusterClientOptions.class, (options) -> assertThat(options.getTopologyRefreshOptions().useDynamicRefreshSources()) .isEqualTo(ClusterTopologyRefreshOptions.DEFAULT_DYNAMIC_REFRESH_SOURCES))); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfigurationTests.java index fd9c4338e1..e51d60b376 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfigurationTests.java @@ -54,7 +54,8 @@ class RedisRepositoriesAutoConfigurationTests { @BeforeEach void setUp() { - TestPropertyValues.of("spring.redis.host=" + redis.getHost(), "spring.redis.port=" + redis.getFirstMappedPort()) + TestPropertyValues + .of("spring.data.redis.host=" + redis.getHost(), "spring.data.redis.port=" + redis.getFirstMappedPort()) .applyTo(this.context.getEnvironment()); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzerTests.java index 7e13fec03d..32adf4969d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/redis/RedisUrlSyntaxFailureAnalyzerTests.java @@ -34,7 +34,7 @@ class RedisUrlSyntaxFailureAnalyzerTests { RedisUrlSyntaxException exception = new RedisUrlSyntaxException("redis://invalid"); FailureAnalysis analysis = new RedisUrlSyntaxFailureAnalyzer().analyze(exception); assertThat(analysis.getDescription()).contains("The URL 'redis://invalid' is not valid"); - assertThat(analysis.getAction()).contains("Review the value of the property 'spring.redis.url'"); + assertThat(analysis.getAction()).contains("Review the value of the property 'spring.data.redis.url'"); } @Test @@ -54,7 +54,7 @@ class RedisUrlSyntaxFailureAnalyzerTests { assertThat(analysis.getDescription()).contains( "The URL 'redis-sentinel://username:password@127.0.0.1:26379,127.0.0.1:26380/mymaster' is not valid") .contains("The scheme 'redis-sentinel' is not supported"); - assertThat(analysis.getAction()).contains("Use spring.redis.sentinel properties"); + assertThat(analysis.getAction()).contains("Use spring.data.redis.sentinel properties"); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/ReactiveSessionAutoConfigurationRedisTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/ReactiveSessionAutoConfigurationRedisTests.java index cd1d74e1c8..ed2fb23de3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/ReactiveSessionAutoConfigurationRedisTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/ReactiveSessionAutoConfigurationRedisTests.java @@ -102,7 +102,7 @@ class ReactiveSessionAutoConfigurationRedisTests extends AbstractSessionAutoConf @Test void sessionCookieConfigurationIsAppliedToAutoConfiguredWebSessionIdResolver() { this.contextRunner.withUserConfiguration(Config.class).withPropertyValues( - "spring.redis.host=" + redis.getHost(), "spring.redis.port=" + redis.getFirstMappedPort(), + "spring.data.redis.host=" + redis.getHost(), "spring.data.redis.port=" + redis.getFirstMappedPort(), "server.reactive.session.cookie.name:JSESSIONID", "server.reactive.session.cookie.domain:.example.com", "server.reactive.session.cookie.path:/example", "server.reactive.session.cookie.max-age:60", "server.reactive.session.cookie.http-only:false", "server.reactive.session.cookie.secure:false", diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java index bffcd2f401..57b48d77f3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/session/SessionAutoConfigurationRedisTests.java @@ -67,8 +67,8 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio @Test void defaultConfig() { this.contextRunner - .withPropertyValues("spring.redis.host=" + redis.getHost(), - "spring.redis.port=" + redis.getFirstMappedPort()) + .withPropertyValues("spring.data.redis.host=" + redis.getHost(), + "spring.data.redis.port=" + redis.getFirstMappedPort()) .withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class)) .run(validateSpringSessionUsesRedis("spring:session:event:0:created:", FlushMode.ON_SAVE, SaveMode.ON_SET_ATTRIBUTE, "0 * * * * *")); @@ -77,8 +77,8 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio @Test void redisTakesPrecedenceMultipleImplementations() { this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class)) - .withPropertyValues("spring.redis.host=" + redis.getHost(), - "spring.redis.port=" + redis.getFirstMappedPort()) + .withPropertyValues("spring.data.redis.host=" + redis.getHost(), + "spring.data.redis.port=" + redis.getFirstMappedPort()) .run(validateSpringSessionUsesRedis("spring:session:event:0:created:", FlushMode.ON_SAVE, SaveMode.ON_SET_ATTRIBUTE, "0 * * * * *")); } @@ -86,8 +86,8 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio @Test void defaultConfigWithCustomTimeout() { this.contextRunner - .withPropertyValues("spring.redis.host=" + redis.getHost(), - "spring.redis.port=" + redis.getFirstMappedPort(), "spring.session.timeout=1m") + .withPropertyValues("spring.data.redis.host=" + redis.getHost(), + "spring.data.redis.port=" + redis.getFirstMappedPort(), "spring.session.timeout=1m") .withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class)).run((context) -> { RedisIndexedSessionRepository repository = validateSessionRepository(context, RedisIndexedSessionRepository.class); @@ -100,8 +100,8 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class)) .withPropertyValues("spring.session.redis.namespace=foo", "spring.session.redis.flush-mode=immediate", "spring.session.redis.save-mode=on-get-attribute", - "spring.session.redis.cleanup-cron=0 0 12 * * *", "spring.redis.host=" + redis.getHost(), - "spring.redis.port=" + redis.getFirstMappedPort()) + "spring.session.redis.cleanup-cron=0 0 12 * * *", "spring.data.redis.host=" + redis.getHost(), + "spring.data.redis.port=" + redis.getFirstMappedPort()) .run(validateSpringSessionUsesRedis("foo:event:0:created:", FlushMode.IMMEDIATE, SaveMode.ON_GET_ATTRIBUTE, "0 0 12 * * *")); } @@ -110,15 +110,16 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio void redisSessionWithConfigureActionNone() { this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class)) .withPropertyValues("spring.session.redis.configure-action=none", - "spring.redis.host=" + redis.getHost(), "spring.redis.port=" + redis.getFirstMappedPort()) + "spring.data.redis.host=" + redis.getHost(), + "spring.data.redis.port=" + redis.getFirstMappedPort()) .run(validateStrategy(ConfigureRedisAction.NO_OP.getClass())); } @Test void redisSessionWithDefaultConfigureActionNone() { this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class)) - .withPropertyValues("spring.redis.host=" + redis.getHost(), - "spring.redis.port=" + redis.getFirstMappedPort()) + .withPropertyValues("spring.data.redis.host=" + redis.getHost(), + "spring.data.redis.port=" + redis.getFirstMappedPort()) .run(validateStrategy(ConfigureNotifyKeyspaceEventsAction.class, entry("notify-keyspace-events", "gxE"))); } @@ -127,8 +128,8 @@ class SessionAutoConfigurationRedisTests extends AbstractSessionAutoConfiguratio void redisSessionWithCustomConfigureRedisActionBean() { this.contextRunner.withConfiguration(AutoConfigurations.of(RedisAutoConfiguration.class)) .withUserConfiguration(MaxEntriesRedisAction.class) - .withPropertyValues("spring.redis.host=" + redis.getHost(), - "spring.redis.port=" + redis.getFirstMappedPort()) + .withPropertyValues("spring.data.redis.host=" + redis.getHost(), + "spring.data.redis.port=" + redis.getFirstMappedPort()) .run(validateStrategy(MaxEntriesRedisAction.class, entry("set-max-intset-entries", "1024"))); } diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc index 91234a6499..77be093356 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/endpoints.adoc @@ -685,7 +685,7 @@ with the `key` listed in the following table: | Checks that a mail server is up. | `mongo` -| {spring-boot-actuator-module-code}/mongo/MongoHealthIndicator.java[`MongoHealthIndicator`] +| {spring-boot-actuator-module-code}/data/mongo/MongoHealthIndicator.java[`MongoHealthIndicator`] | Checks that a Mongo database is up. | `neo4j` @@ -701,7 +701,7 @@ with the `key` listed in the following table: | Checks that a Rabbit server is up. | `redis` -| {spring-boot-actuator-module-code}/redis/RedisHealthIndicator.java[`RedisHealthIndicator`] +| {spring-boot-actuator-module-code}/data/redis/RedisHealthIndicator.java[`RedisHealthIndicator`] | Checks that a Redis server is up. |=== @@ -833,11 +833,11 @@ When appropriate, Spring Boot auto-configures the following `ReactiveHealthIndic | Checks that a Couchbase cluster is up. | `elasticsearch` -| {spring-boot-actuator-module-code}/elasticsearch/ElasticsearchReactiveHealthIndicator.java[`ElasticsearchReactiveHealthIndicator`] +| {spring-boot-actuator-module-code}/data/elasticsearch/ElasticsearchReactiveHealthIndicator.java[`ElasticsearchReactiveHealthIndicator`] | Checks that an Elasticsearch cluster is up. | `mongo` -| {spring-boot-actuator-module-code}/mongo/MongoReactiveHealthIndicator.java[`MongoReactiveHealthIndicator`] +| {spring-boot-actuator-module-code}/data/mongo/MongoReactiveHealthIndicator.java[`MongoReactiveHealthIndicator`] | Checks that a Mongo database is up. | `neo4j` @@ -845,7 +845,7 @@ When appropriate, Spring Boot auto-configures the following `ReactiveHealthIndic | Checks that a Neo4j database is up. | `redis` -| {spring-boot-actuator-module-code}/redis/RedisReactiveHealthIndicator.java[`RedisReactiveHealthIndicator`] +| {spring-boot-actuator-module-code}/data/redis/RedisReactiveHealthIndicator.java[`RedisReactiveHealthIndicator`] | Checks that a Redis server is up. |=== diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc index 3440b9b8cb..0cca88c582 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc @@ -326,17 +326,16 @@ There is a `spring-boot-starter-data-cassandra` "`Starter`" for collecting the d [[data.nosql.cassandra.connecting]] ==== Connecting to Cassandra You can inject an auto-configured `CassandraTemplate` or a Cassandra `CqlSession` instance as you would with any other Spring Bean. -The `spring.data.cassandra.*` properties can be used to customize the connection. +The `spring.cassandra.*` properties can be used to customize the connection. Generally, you provide `keyspace-name` and `contact-points` as well the local datacenter name, as shown in the following example: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- spring: - data: - cassandra: - keyspace-name: "mykeyspace" - contact-points: "cassandrahost1:9042,cassandrahost2:9042" - local-datacenter: "datacenter1" + cassandra: + keyspace-name: "mykeyspace" + contact-points: "cassandrahost1:9042,cassandrahost2:9042" + local-datacenter: "datacenter1" ---- If the port is the same for all your contact points you can use a shortcut and only specify the host names, as shown in the following example: @@ -344,22 +343,21 @@ If the port is the same for all your contact points you can use a shortcut and o [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- spring: - data: - cassandra: - keyspace-name: "mykeyspace" - contact-points: "cassandrahost1,cassandrahost2" - local-datacenter: "datacenter1" + cassandra: + keyspace-name: "mykeyspace" + contact-points: "cassandrahost1,cassandrahost2" + local-datacenter: "datacenter1" ---- TIP: Those two examples are identical as the port default to `9042`. -If you need to configure the port, use `spring.data.cassandra.port`. +If you need to configure the port, use `spring.cassandra.port`. [NOTE] ==== The Cassandra driver has its own configuration infrastructure that loads an `application.conf` at the root of the classpath. -Spring Boot does not look for such a file by default but can load one using `spring.data.cassandra.config`. -If a property is both present in `+spring.data.cassandra.*+` and the configuration file, the value in `+spring.data.cassandra.*+` takes precedence. +Spring Boot does not look for such a file by default but can load one using `spring.cassandra.config`. +If a property is both present in `+spring.cassandra.*+` and the configuration file, the value in `+spring.cassandra.*+` takes precedence. For more advanced driver customizations, you can register an arbitrary number of beans that implement `DriverConfigLoaderBuilderCustomizer`. The `CqlSession` can be customized with a bean of type `CqlSessionBuilderCustomizer`. diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTestIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTestIntegrationTests.java index 0b568c96bb..20c15f1e3a 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTestIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTestIntegrationTests.java @@ -43,10 +43,9 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; * * @author Artsiom Yudovin */ -@DataCassandraTest(properties = { "spring.data.cassandra.local-datacenter=datacenter1", - "spring.data.cassandra.schema-action=create-if-not-exists", - "spring.data.cassandra.connection.connect-timeout=60s", - "spring.data.cassandra.connection.init-query-timeout=60s", "spring.data.cassandra.request.timeout=60s" }) +@DataCassandraTest(properties = { "spring.cassandra.local-datacenter=datacenter1", + "spring.cassandra.schema-action=create-if-not-exists", "spring.cassandra.connection.connect-timeout=60s", + "spring.cassandra.connection.init-query-timeout=60s", "spring.cassandra.request.timeout=60s" }) @Testcontainers(disabledWithoutDocker = true) class DataCassandraTestIntegrationTests { @@ -55,7 +54,7 @@ class DataCassandraTestIntegrationTests { @DynamicPropertySource static void cassandraProperties(DynamicPropertyRegistry registry) { - registry.add("spring.data.cassandra.contact-points", + registry.add("spring.cassandra.contact-points", () -> cassandra.getHost() + ":" + cassandra.getFirstMappedPort()); } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTestWithIncludeFilterIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTestWithIncludeFilterIntegrationTests.java index 14efc3a82e..eaf7de7cab 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTestWithIncludeFilterIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/cassandra/DataCassandraTestWithIncludeFilterIntegrationTests.java @@ -42,11 +42,10 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Artsiom Yudovin */ @DataCassandraTest(includeFilters = @Filter(Service.class), - properties = { "spring.data.cassandra.local-datacenter=datacenter1", - "spring.data.cassandra.schema-action=create-if-not-exists", - "spring.data.cassandra.connection.connect-timeout=60s", - "spring.data.cassandra.connection.init-query-timeout=60s", - "spring.data.cassandra.request.timeout=60s" }) + properties = { "spring.cassandra.local-datacenter=datacenter1", + "spring.cassandra.schema-action=create-if-not-exists", + "spring.cassandra.connection.connect-timeout=60s", "spring.cassandra.connection.init-query-timeout=60s", + "spring.cassandra.request.timeout=60s" }) @Testcontainers(disabledWithoutDocker = true) class DataCassandraTestWithIncludeFilterIntegrationTests { @@ -55,7 +54,7 @@ class DataCassandraTestWithIncludeFilterIntegrationTests { @DynamicPropertySource static void cassandraProperties(DynamicPropertyRegistry registry) { - registry.add("spring.data.cassandra.contact-points", + registry.add("spring.cassandra.contact-points", () -> cassandra.getHost() + ":" + cassandra.getFirstMappedPort()); } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestIntegrationTests.java index 7871e3a94a..a3b6f98427 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestIntegrationTests.java @@ -60,8 +60,8 @@ class DataRedisTestIntegrationTests { @DynamicPropertySource static void redisProperties(DynamicPropertyRegistry registry) { - registry.add("spring.redis.host", redis::getHost); - registry.add("spring.redis.port", redis::getFirstMappedPort); + registry.add("spring.data.redis.host", redis::getHost); + registry.add("spring.data.redis.port", redis::getFirstMappedPort); } @Test diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestPropertiesIntegrationTests.java index 4f48974f02..aaa16e5553 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestPropertiesIntegrationTests.java @@ -46,8 +46,8 @@ class DataRedisTestPropertiesIntegrationTests { @DynamicPropertySource static void redisProperties(DynamicPropertyRegistry registry) { - registry.add("spring.redis.host", redis::getHost); - registry.add("spring.redis.port", redis::getFirstMappedPort); + registry.add("spring.data.redis.host", redis::getHost); + registry.add("spring.data.redis.port", redis::getFirstMappedPort); } @Test diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestReactiveIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestReactiveIntegrationTests.java index 8bfa677a1d..c0ded8d68b 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestReactiveIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestReactiveIntegrationTests.java @@ -53,8 +53,8 @@ class DataRedisTestReactiveIntegrationTests { @DynamicPropertySource static void redisProperties(DynamicPropertyRegistry registry) { - registry.add("spring.redis.host", redis::getHost); - registry.add("spring.redis.port", redis::getFirstMappedPort); + registry.add("spring.data.redis.host", redis::getHost); + registry.add("spring.data.redis.port", redis::getFirstMappedPort); } @Test diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestWithIncludeFilterIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestWithIncludeFilterIntegrationTests.java index bd4e7ecc93..a6a8cc7a41 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestWithIncludeFilterIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestWithIncludeFilterIntegrationTests.java @@ -49,8 +49,8 @@ class DataRedisTestWithIncludeFilterIntegrationTests { @DynamicPropertySource static void redisProperties(DynamicPropertyRegistry registry) { - registry.add("spring.redis.host", redis::getHost); - registry.add("spring.redis.port", redis::getFirstMappedPort); + registry.add("spring.data.redis.host", redis::getHost); + registry.add("spring.data.redis.port", redis::getFirstMappedPort); } @Test diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-redis/src/test/java/smoketest/session/redis/SampleSessionRedisApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-redis/src/test/java/smoketest/session/redis/SampleSessionRedisApplicationTests.java index f65481b146..7023372543 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-redis/src/test/java/smoketest/session/redis/SampleSessionRedisApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-redis/src/test/java/smoketest/session/redis/SampleSessionRedisApplicationTests.java @@ -56,8 +56,8 @@ public class SampleSessionRedisApplicationTests { @DynamicPropertySource static void applicationProperties(DynamicPropertyRegistry registry) { - registry.add("spring.redis.host", redis::getHost); - registry.add("spring.redis.port", redis::getFirstMappedPort); + registry.add("spring.data.redis.host", redis::getHost); + registry.add("spring.data.redis.port", redis::getFirstMappedPort); } @Test diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-webflux-redis/src/test/java/smoketest/session/SampleSessionWebFluxRedisApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-webflux-redis/src/test/java/smoketest/session/SampleSessionWebFluxRedisApplicationTests.java index 3c7bf07e6c..9b50b5d3da 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-webflux-redis/src/test/java/smoketest/session/SampleSessionWebFluxRedisApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-session-webflux-redis/src/test/java/smoketest/session/SampleSessionWebFluxRedisApplicationTests.java @@ -56,8 +56,8 @@ class SampleSessionWebFluxRedisApplicationTests { @DynamicPropertySource static void applicationProperties(DynamicPropertyRegistry registry) { - registry.add("spring.redis.host", redis::getHost); - registry.add("spring.redis.port", redis::getFirstMappedPort); + registry.add("spring.data.redis.host", redis::getHost); + registry.add("spring.data.redis.port", redis::getFirstMappedPort); } @Test