Add static PropertySourcesPlaceholderConfigurer bean definition for resolving Spring @Value annotation property placeholders.

This commit is contained in:
John Blum
2018-08-13 13:03:22 -07:00
parent 68b25ebdb9
commit 80d09144b4

View File

@@ -27,6 +27,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.data.gemfire.config.annotation.CacheServerConfigurer;
import org.springframework.data.gemfire.config.annotation.ClientCacheConfigurer;
import org.springframework.data.gemfire.support.ConnectionEndpoint;
@@ -54,6 +55,12 @@ public class ClientServerIntegrationTestsConfiguration {
return this.logger;
}
@Bean
// Required bean to resolve property placeholders in Spring @Value annotations.
static PropertySourcesPlaceholderConfigurer propertyPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();
}
@Bean
ClientCacheConfigurer clientCachePoolPortConfigurer(
@Value("${" + GEMFIRE_CACHE_SERVER_PORT_PROPERTY + ":40404}") int port) {