From d091be04984edd16b4bdb06bbfaf46c2e908ae76 Mon Sep 17 00:00:00 2001 From: John Blum Date: Wed, 20 Jan 2021 14:44:51 -0800 Subject: [PATCH] Add assertion asserting the 'spring.data.gemfire.cache.client.region.shortcut' property is still set to 'LOCAL' even when 'strictMatch' is 'true' and no cluster is available. --- ...hingClusterNotAvailableConfigurationIntegrationTests.java | 5 +++++ ...hingClusterNotAvailableConfigurationIntegrationTests.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/spring-geode/src/test/java/org/springframework/geode/config/annotation/PropertyConfiguredStrictMatchingClusterNotAvailableConfigurationIntegrationTests.java b/spring-geode/src/test/java/org/springframework/geode/config/annotation/PropertyConfiguredStrictMatchingClusterNotAvailableConfigurationIntegrationTests.java index a7980710..c4a8f511 100644 --- a/spring-geode/src/test/java/org/springframework/geode/config/annotation/PropertyConfiguredStrictMatchingClusterNotAvailableConfigurationIntegrationTests.java +++ b/spring-geode/src/test/java/org/springframework/geode/config/annotation/PropertyConfiguredStrictMatchingClusterNotAvailableConfigurationIntegrationTests.java @@ -23,6 +23,7 @@ import org.junit.AfterClass; import org.junit.Test; import org.apache.geode.cache.client.ClientCache; +import org.apache.geode.cache.client.ClientRegionShortcut; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.core.NestedExceptionUtils; @@ -88,6 +89,10 @@ public class PropertyConfiguredStrictMatchingClusterNotAvailableConfigurationInt throw expected; } + finally { + assertThat(System.getProperty(ClusterAwareConfiguration.SPRING_DATA_GEMFIRE_CACHE_CLIENT_REGION_SHORTCUT_PROPERTY)) + .isEqualTo(ClientRegionShortcut.LOCAL.name()); + } } @ClientCacheApplication diff --git a/spring-geode/src/test/java/org/springframework/geode/config/annotation/StrictMatchingClusterNotAvailableConfigurationIntegrationTests.java b/spring-geode/src/test/java/org/springframework/geode/config/annotation/StrictMatchingClusterNotAvailableConfigurationIntegrationTests.java index add974fe..32318229 100644 --- a/spring-geode/src/test/java/org/springframework/geode/config/annotation/StrictMatchingClusterNotAvailableConfigurationIntegrationTests.java +++ b/spring-geode/src/test/java/org/springframework/geode/config/annotation/StrictMatchingClusterNotAvailableConfigurationIntegrationTests.java @@ -21,6 +21,7 @@ import org.junit.AfterClass; import org.junit.Test; import org.apache.geode.cache.client.ClientCache; +import org.apache.geode.cache.client.ClientRegionShortcut; import org.springframework.core.NestedExceptionUtils; import org.springframework.data.gemfire.config.annotation.ClientCacheApplication; @@ -69,6 +70,10 @@ public class StrictMatchingClusterNotAvailableConfigurationIntegrationTests throw expected; } + finally { + assertThat(System.getProperty(ClusterAwareConfiguration.SPRING_DATA_GEMFIRE_CACHE_CLIENT_REGION_SHORTCUT_PROPERTY)) + .isEqualTo(ClientRegionShortcut.LOCAL.name()); + } } @ClientCacheApplication