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.

This commit is contained in:
John Blum
2018-11-05 22:44:56 -08:00
parent 8ff823b268
commit 1b5f8e22d2

View File

@@ -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