From 295975e73bb5383806e29fefc17bdb59574ebee6 Mon Sep 17 00:00:00 2001 From: John Blum Date: Fri, 21 Feb 2020 19:22:08 -0800 Subject: [PATCH] Remove use of the org.apache.geode.internal.cache.GemFireCacheImpl class to assert the cache instance is a client. Resolves gh-70. --- ...otApacheGeodeClientCacheApplicationIntegrationTests.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/cache/client/SpringBootApacheGeodeClientCacheApplicationIntegrationTests.java b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/cache/client/SpringBootApacheGeodeClientCacheApplicationIntegrationTests.java index 8e6bc52c..71e1af7d 100644 --- a/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/cache/client/SpringBootApacheGeodeClientCacheApplicationIntegrationTests.java +++ b/spring-geode-autoconfigure/src/test/java/org/springframework/geode/boot/autoconfigure/cache/client/SpringBootApacheGeodeClientCacheApplicationIntegrationTests.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.cache.client.ClientRegionShortcut; -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.client.ClientRegionFactoryBean; import org.springframework.data.gemfire.config.annotation.EnableLogging; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; @@ -68,9 +68,7 @@ public class SpringBootApacheGeodeClientCacheApplicationIntegrationTests extends public void clientCacheAndClientRegionAreAvailable() { Optional.ofNullable(this.clientCache) - .filter(GemFireCacheImpl.class::isInstance) - .map(GemFireCacheImpl.class::cast) - .map(it -> assertThat(it.isClient()).isTrue()) + .map(it -> assertThat(GemfireUtils.isClient(it)).isTrue()) .orElseThrow(() -> newIllegalStateException("ClientCache was null")); Region example = this.clientCache.getRegion("Example");