From 7ed4273fc33ab625ee0e289fb817003bb07f23e1 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Fri, 16 Feb 2018 14:43:45 +0100 Subject: [PATCH] Fix Redis Cache tests after key prefix changes Update Redis Cache tests after changes in DATAREDIS-715. --- .../cache/CacheAutoConfigurationTests.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java index a6ed0d384b..14fe38176c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java @@ -283,8 +283,8 @@ public class CacheAutoConfigurationTests { .withPropertyValues("spring.cache.type=redis", "spring.cache.redis.time-to-live=15000", "spring.cache.redis.cacheNullValues=false", - "spring.cache.redis.keyPrefix=foo", - "spring.cache.redis.useKeyPrefix=false") + "spring.cache.redis.keyPrefix=prefix", + "spring.cache.redis.useKeyPrefix=true") .run((context) -> { RedisCacheManager cacheManager = getCacheManager(context, RedisCacheManager.class); @@ -295,8 +295,8 @@ public class CacheAutoConfigurationTests { .isEqualTo(java.time.Duration.ofSeconds(15)); assertThat(redisCacheConfiguration.getAllowCacheNullValues()) .isFalse(); - assertThat(redisCacheConfiguration.getKeyPrefix()).contains("foo"); - assertThat(redisCacheConfiguration.usePrefix()).isFalse(); + assertThat(redisCacheConfiguration.getKeyPrefixFor("keyName")).isEqualTo("prefix"); + assertThat(redisCacheConfiguration.usePrefix()).isTrue(); }); } @@ -342,7 +342,7 @@ public class CacheAutoConfigurationTests { .isEqualTo(java.time.Duration.ofMinutes(0)); assertThat(redisCacheConfiguration.getAllowCacheNullValues()) .isTrue(); - assertThat(redisCacheConfiguration.getKeyPrefix()).isEmpty(); + assertThat(redisCacheConfiguration.getKeyPrefixFor("test")).isEqualTo("test::"); assertThat(redisCacheConfiguration.usePrefix()).isTrue(); }); }