diff --git a/src/main/java/org/springframework/data/redis/connection/RedisServer.java b/src/main/java/org/springframework/data/redis/connection/RedisServer.java index a682c146c..b5d2bef28 100644 --- a/src/main/java/org/springframework/data/redis/connection/RedisServer.java +++ b/src/main/java/org/springframework/data/redis/connection/RedisServer.java @@ -24,7 +24,6 @@ import org.springframework.util.StringUtils; * @author Christoph Strobl * @author Thomas Darimont * @author Franjo Zilic - * * @since 1.4 */ public class RedisServer extends RedisNode { @@ -65,7 +64,7 @@ public class RedisServer extends RedisNode { /** * Creates a new {@link RedisServer} with the given {@code host}, {@code port}. - * + * * @param host must not be {@literal null} * @param port */ @@ -75,7 +74,7 @@ public class RedisServer extends RedisNode { /** * Creates a new {@link RedisServer} with the given {@code host}, {@code port} and {@code properties}. - * + * * @param host must not be {@literal null} * @param port * @param properties may be {@literal null} @@ -95,7 +94,7 @@ public class RedisServer extends RedisNode { /** * Creates a new {@link RedisServer} from the given properties. - * + * * @param properties * @return */ diff --git a/src/test/java/org/springframework/data/redis/connection/RedisServerUnitTests.java b/src/test/java/org/springframework/data/redis/connection/RedisServerUnitTests.java new file mode 100644 index 000000000..6e820cc7f --- /dev/null +++ b/src/test/java/org/springframework/data/redis/connection/RedisServerUnitTests.java @@ -0,0 +1,48 @@ +/* + * Copyright 2017 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 + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.data.redis.connection; + +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +import java.util.Properties; + +import org.junit.Test; + +/** + * Unit tests for {@link RedisServer}. + * + * @author Mark Paluch + */ +public class RedisServerUnitTests { + + @Test // DATAREDIS-618 + public void shouldReadNumberOfOtherSentinelsCorrectly() { + + RedisServer redisServer = RedisServer.newServerFrom(createProperties()); + + assertThat(redisServer.getNumberOtherSentinels(), is(2L)); + } + + private Properties createProperties() { + + Properties map = new Properties(); + + map.put("num-other-sentinels", "2"); + + return map; + } +}