Skip to content

Commit 1e4cc94

Browse files
committed
Polish "Validate node configuration with static master replica"
See gh-47401
1 parent 4fd9626 commit 1e4cc94

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

module/spring-boot-data-redis/src/test/java/org/springframework/boot/data/redis/autoconfigure/DataRedisAutoConfigurationTests.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,15 @@ void testRedisConfigurationWithClusterAndAuthentication() {
500500
});
501501
}
502502

503+
@Test
504+
void testRedisConfigurationWithMasterReplicaAndNoNode() {
505+
this.contextRunner.withPropertyValues("spring.data.redis.masterreplica.nodes=")
506+
.run((context) -> assertThat(context).hasFailed()
507+
.getFailure()
508+
.rootCause()
509+
.hasMessage("At least one node is required for master-replica configuration"));
510+
}
511+
503512
@Test
504513
void testRedisConfigurationWithMasterReplica() {
505514
this.contextRunner

0 commit comments

Comments
 (0)