From a781c77140b6b47a7620d3f1f045b021cee79ea1 Mon Sep 17 00:00:00 2001 From: John Blum Date: Thu, 31 May 2018 13:19:12 -0700 Subject: [PATCH] Clean up any o.a.g.security.SecurityManager references before and after test execution. --- .../support/SecurityManagerProxyIntegrationTests.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/geode-spring-boot/src/test/java/org/springframework/geode/security/support/SecurityManagerProxyIntegrationTests.java b/geode-spring-boot/src/test/java/org/springframework/geode/security/support/SecurityManagerProxyIntegrationTests.java index 2bb10dfd..0e3e1bb8 100644 --- a/geode-spring-boot/src/test/java/org/springframework/geode/security/support/SecurityManagerProxyIntegrationTests.java +++ b/geode-spring-boot/src/test/java/org/springframework/geode/security/support/SecurityManagerProxyIntegrationTests.java @@ -31,6 +31,7 @@ import org.springframework.data.gemfire.config.annotation.PeerCacheApplication; import org.springframework.data.gemfire.support.GemfireBeanFactoryLocatorProxy; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects; +import org.springframework.geode.core.util.ObjectUtils; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; @@ -61,8 +62,14 @@ public class SecurityManagerProxyIntegrationTests extends IntegrationTestsSuppor @BeforeClass @AfterClass - public static void cleanUpBeanFactoryLocatorReferences() { + public static void cleanUpBeanFactoryLocatorReferences() throws Exception { + GemfireBeanFactoryLocatorProxy.clear(); + + ObjectUtils.doOperationSafely(() -> { + SecurityManagerProxy.getInstance().destroy(); + return true; + }, true); } @Autowired