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 973204396c..658d2f31eb 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 @@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisClusterConfiguration; import org.springframework.data.redis.connection.RedisNode; import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceClientConfigurationBuilder; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; @@ -231,9 +232,17 @@ public class RedisAutoConfigurationTests { .withPropertyValues( "spring.redis.cluster.nodes[0]:" + clusterNodes.get(0), "spring.redis.cluster.nodes[1]:" + clusterNodes.get(1)) - .run((context) -> assertThat(context - .getBean(LettuceConnectionFactory.class).getClusterConnection()) - .isNotNull()); + .run((context) -> { + RedisClusterConfiguration clusterConfiguration = context + .getBean(LettuceConnectionFactory.class) + .getClusterConfiguration(); + assertThat(clusterConfiguration.getClusterNodes()).hasSize(2); + assertThat(clusterConfiguration.getClusterNodes()) + .extracting((node) -> node.getHost() + ":" + node.getPort()) + .containsExactlyInAnyOrder("127.0.0.1:27379", + "127.0.0.1:27380"); + }); + } @Test diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml index 0998baf4da..143bd6da62 100644 --- a/spring-boot-project/spring-boot-dependencies/pom.xml +++ b/spring-boot-project/spring-boot-dependencies/pom.xml @@ -116,7 +116,7 @@ 1.1.0 1.1.0 1.2.41 - 5.0.4.RELEASE + 5.1.0.M1 3.6.1 2.10.0 1.2.3