Skip to content
Permalink
Browse files
Add ManualRedisTopology test for hosts and ports (#151)
  • Loading branch information
sabbey37 committed May 17, 2021
1 parent 3a58d10 commit dfbe030bb97043dfc93ea6be4166c6f747e1249c
Showing 1 changed file with 14 additions and 1 deletion.
@@ -45,7 +45,7 @@ public void configureWithOneServer() {

@Test
@SetSystemProperty(key = WITH_REDIS_SERVERS_PROPERTY, value = "a;b;c")
public void configureWithMultipleServer() {
public void configureWithMultipleServers() {
final TestConfig testConfig = new TestConfig();
ManualRedisTopology.configure(testConfig);
assertThat(testConfig.getBefore().stream().map(TestStep::getTask)
@@ -56,6 +56,19 @@ public void configureWithMultipleServer() {
createUnresolved("c", REDIS_PORT)));
}

@Test
@SetSystemProperty(key = WITH_REDIS_SERVERS_PROPERTY, value = "a:1;b:2;c:3")
public void configureWithMultipleServersWithHostsAndPorts() {
final TestConfig testConfig = new TestConfig();
ManualRedisTopology.configure(testConfig);
assertThat(testConfig.getBefore().stream().map(TestStep::getTask)
.filter(InitRedisServersAttribute.class::isInstance)
.map(InitRedisServersAttribute.class::cast)
.findFirst()).hasValueSatisfying(t -> assertThat(t.getServers()).containsExactly(
createUnresolved("a", 1), createUnresolved("b", 2),
createUnresolved("c", 3)));
}

@Test
@ClearSystemProperty(key = WITH_REDIS_SERVERS_PROPERTY)
public void configureWithNoServersThrows() {

0 comments on commit dfbe030

Please sign in to comment.