From a08f9bb0e8723f2c515762d036cc58014ba961b0 Mon Sep 17 00:00:00 2001 From: John Blum Date: Fri, 21 Feb 2020 19:08:46 -0800 Subject: [PATCH] Remove use of the org.apache.geode.internal.cache.GemFireCacheImpl class to assert the cache instance is not a client. Resolves gh-70. --- ...cheGeodePeerCacheApplicationIntegrationTests.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/cache/peer/SpringBootApacheGeodePeerCacheApplicationIntegrationTests.java b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/cache/peer/SpringBootApacheGeodePeerCacheApplicationIntegrationTests.java index 1d08f800a..dea1a4ab5 100644 --- a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/cache/peer/SpringBootApacheGeodePeerCacheApplicationIntegrationTests.java +++ b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/cache/peer/SpringBootApacheGeodePeerCacheApplicationIntegrationTests.java @@ -27,12 +27,12 @@ import org.apache.geode.cache.GemFireCache; import org.apache.geode.cache.Region; import org.apache.geode.cache.client.ClientCache; -import org.apache.geode.internal.cache.GemFireCacheImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Bean; +import org.springframework.data.gemfire.GemfireUtils; import org.springframework.data.gemfire.LocalRegionFactoryBean; import org.springframework.data.gemfire.config.annotation.PeerCacheApplication; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; @@ -60,8 +60,6 @@ @SuppressWarnings("unused") public class SpringBootApacheGeodePeerCacheApplicationIntegrationTests extends IntegrationTestsSupport { - private static final String GEMFIRE_LOG_LEVEL = "error"; - @Autowired private GemFireCache peerCache; @@ -69,12 +67,10 @@ public class SpringBootApacheGeodePeerCacheApplicationIntegrationTests extends I public void peerCacheWithPeerLocalRegionAreAvailable() { Optional.ofNullable(this.peerCache) - .filter(GemFireCacheImpl.class::isInstance) - .map(GemFireCacheImpl.class::cast) - .map(it -> assertThat(it.isClient()).isFalse()) + .map(it -> assertThat(GemfireUtils.isClient(it)).isFalse()) .orElseThrow(() -> newIllegalStateException("Peer cache was null")); - Region example = peerCache.getRegion("/Example"); + Region example = this.peerCache.getRegion("/Example"); assertThat(example).isNotNull(); assertThat(example.getName()).isEqualTo("Example"); @@ -86,7 +82,7 @@ public void peerCacheWithPeerLocalRegionAreAvailable() { } @SpringBootApplication - @PeerCacheApplication(logLevel = GEMFIRE_LOG_LEVEL) + @PeerCacheApplication static class TestConfiguration { @Bean("Example")