From 85e280c3be020c088a85040f2ace6ade2d4402d0 Mon Sep 17 00:00:00 2001 From: John Blum Date: Wed, 27 Oct 2021 11:00:38 -0700 Subject: [PATCH] Fix logic in isSpringTestContextCacheEnabled() method. --- .../cache/ConfigurableCacheAwareContextLoaderDelegate.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-data-geode-test/src/main/java/org/springframework/data/gemfire/tests/extensions/spring/test/context/cache/ConfigurableCacheAwareContextLoaderDelegate.java b/spring-data-geode-test/src/main/java/org/springframework/data/gemfire/tests/extensions/spring/test/context/cache/ConfigurableCacheAwareContextLoaderDelegate.java index 10562b8..813c6ac 100644 --- a/spring-data-geode-test/src/main/java/org/springframework/data/gemfire/tests/extensions/spring/test/context/cache/ConfigurableCacheAwareContextLoaderDelegate.java +++ b/spring-data-geode-test/src/main/java/org/springframework/data/gemfire/tests/extensions/spring/test/context/cache/ConfigurableCacheAwareContextLoaderDelegate.java @@ -72,7 +72,9 @@ public class ConfigurableCacheAwareContextLoaderDelegate extends DefaultCacheAwa String cacheEnabledProperty = SpringProperties.getProperty(SPRING_TEST_CONTEXT_CACHE_ENABLED_PROPERTY); - boolean resolvedCacheEnabled = !StringUtils.hasText(cacheEnabledProperty) && defaultCacheEnabled; + boolean resolvedCacheEnabled = + (!StringUtils.hasText(cacheEnabledProperty) || Boolean.parseBoolean(cacheEnabledProperty)) + && defaultCacheEnabled; return resolvedCacheEnabled; }; @@ -90,7 +92,7 @@ public class ConfigurableCacheAwareContextLoaderDelegate extends DefaultCacheAwa : loadContextInternal(mergedContextConfiguration); } catch (Exception cause) { - throw newIllegalStateException(cause, "Failed to load ApplicationContext for configuration [%s]", + throw newIllegalStateException(cause, "Failed to load ApplicationContext for context configuration [%s]", mergedContextConfiguration); } }