From c4e3b832ededfbdd9516aadab61bc08dac38f914 Mon Sep 17 00:00:00 2001 From: John Blum Date: Mon, 28 May 2018 17:28:38 -0700 Subject: [PATCH] Rename application.properties for SSL integration testing to application-ssl.properties. --- .../ssl/AutoConfiguredSslIntegrationTests.java | 12 ++++++++++-- ...ication.properties => application-ssl.properties} | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) rename geode-spring-boot-starter/src/test/resources/{application.properties => application-ssl.properties} (99%) diff --git a/geode-spring-boot-starter/src/test/java/org/springframework/boot/data/geode/security/ssl/AutoConfiguredSslIntegrationTests.java b/geode-spring-boot-starter/src/test/java/org/springframework/boot/data/geode/security/ssl/AutoConfiguredSslIntegrationTests.java index f87ce235..aa89d694 100644 --- a/geode-spring-boot-starter/src/test/java/org/springframework/boot/data/geode/security/ssl/AutoConfiguredSslIntegrationTests.java +++ b/geode-spring-boot-starter/src/test/java/org/springframework/boot/data/geode/security/ssl/AutoConfiguredSslIntegrationTests.java @@ -34,11 +34,12 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.data.geode.core.util.ObjectUtils; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.PropertySource; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.data.gemfire.PartitionedRegionFactoryBean; @@ -50,6 +51,7 @@ import org.springframework.data.gemfire.config.annotation.PeerCacheConfigurer; import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport; import org.springframework.data.gemfire.tests.integration.config.ClientServerIntegrationTestsConfiguration; import org.springframework.data.gemfire.tests.util.FileSystemUtils; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -74,6 +76,7 @@ import example.geode.cache.EchoCacheLoader; * @see org.springframework.test.context.junit4.SpringRunner * @since 1.0.0 */ +@ActiveProfiles("ssl") @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = AutoConfiguredSslIntegrationTests.GemFireClientConfiguration.class) @@ -215,10 +218,15 @@ public class AutoConfiguredSslIntegrationTests extends ForkingClientServerIntegr @EnableSsl @CacheServerApplication(name = "AutoConfiguredSslIntegrationTests", logLevel = GEMFIRE_LOG_LEVEL) + @PropertySource(name = "gemfire-ssl", value = "application-ssl.properties") static class GemFireServerConfiguration { public static void main(String[] args) { - SpringApplication.run(GemFireServerConfiguration.class, args); + + AnnotationConfigApplicationContext applicationContext = + new AnnotationConfigApplicationContext(GemFireServerConfiguration.class); + + applicationContext.registerShutdownHook(); } @Bean diff --git a/geode-spring-boot-starter/src/test/resources/application.properties b/geode-spring-boot-starter/src/test/resources/application-ssl.properties similarity index 99% rename from geode-spring-boot-starter/src/test/resources/application.properties rename to geode-spring-boot-starter/src/test/resources/application-ssl.properties index 0cbede81..46e527fc 100644 --- a/geode-spring-boot-starter/src/test/resources/application.properties +++ b/geode-spring-boot-starter/src/test/resources/application-ssl.properties @@ -1,3 +1,4 @@ # Spring Boot application.properties for testing + spring.data.gemfire.security.ssl.keystore.password=s3cr3t spring.data.gemfire.security.ssl.truststore.password=s3cr3t