From 1b5f8e22d20a1872ac808cf65b95318f25b0feaf Mon Sep 17 00:00:00 2001 From: John Blum Date: Mon, 5 Nov 2018 22:44:56 -0800 Subject: [PATCH] Change the 'port' method parameter, @Value annotation configuration of the 'spring.data.gemfire.cache.server.port' property to use CacheServer.DEFAULT_PORT as the default value. --- ...lientServerIntegrationTestsConfiguration.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/spring-data-geode-test/src/main/java/org/springframework/data/gemfire/tests/integration/config/ClientServerIntegrationTestsConfiguration.java b/spring-data-geode-test/src/main/java/org/springframework/data/gemfire/tests/integration/config/ClientServerIntegrationTestsConfiguration.java index 3823afc..0761532 100644 --- a/spring-data-geode-test/src/main/java/org/springframework/data/gemfire/tests/integration/config/ClientServerIntegrationTestsConfiguration.java +++ b/spring-data-geode-test/src/main/java/org/springframework/data/gemfire/tests/integration/config/ClientServerIntegrationTestsConfiguration.java @@ -69,6 +69,8 @@ import org.springframework.util.ClassUtils; @SuppressWarnings("unused") public class ClientServerIntegrationTestsConfiguration { + private static final int DEFAULT_PORT = CacheServer.DEFAULT_PORT; + private final Logger logger = LoggerFactory.getLogger(getClass()); protected Logger getLogger() { @@ -83,18 +85,18 @@ public class ClientServerIntegrationTestsConfiguration { } @Bean - ClientCacheConfigurer clientCachePoolPortConfigurer( - @Value("${" + GEMFIRE_CACHE_SERVER_PORT_PROPERTY + ":40404}") int port) { + CacheServerConfigurer cacheServerPortConfigurer( + @Value("${" + GEMFIRE_CACHE_SERVER_PORT_PROPERTY + ":" + DEFAULT_PORT + "}") int port) { - return (beanName, clientCacheFactoryBean) -> clientCacheFactoryBean.setServers( - Collections.singletonList(new ConnectionEndpoint("localhost", port))); + return (beanName, cacheServerFactoryBean) -> cacheServerFactoryBean.setPort(port); } @Bean - CacheServerConfigurer cacheServerPortConfigurer( - @Value("${" + GEMFIRE_CACHE_SERVER_PORT_PROPERTY + ":40404}") int port) { + ClientCacheConfigurer clientCachePoolPortConfigurer( + @Value("${" + GEMFIRE_CACHE_SERVER_PORT_PROPERTY + ":" + DEFAULT_PORT + "}") int port) { - return (beanName, cacheServerFactoryBean) -> cacheServerFactoryBean.setPort(port); + return (beanName, clientCacheFactoryBean) -> clientCacheFactoryBean.setServers( + Collections.singletonList(new ConnectionEndpoint("localhost", port))); } @Configuration