From 1a6f51a7f9d3a09b72b6d9222afe65692445a3f7 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Thu, 16 Nov 2017 12:36:13 +0100 Subject: [PATCH] DATAREDIS-728 - Polishing. Add tests. Add author tag. Original pull request: #293. --- .../springframework/data/redis/cache/RedisCacheManager.java | 1 + .../data/redis/cache/RedisCacheManagerUnitTests.java | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java b/src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java index 5ebe1677e..daa6d2b1a 100644 --- a/src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java +++ b/src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java @@ -215,6 +215,7 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager * * @author Christoph Strobl * @author Mark Strobl + * @author Kezhu Wang * @since 2.0 */ public static class RedisCacheManagerBuilder { diff --git a/src/test/java/org/springframework/data/redis/cache/RedisCacheManagerUnitTests.java b/src/test/java/org/springframework/data/redis/cache/RedisCacheManagerUnitTests.java index a1968f53f..41e4cf0d3 100644 --- a/src/test/java/org/springframework/data/redis/cache/RedisCacheManagerUnitTests.java +++ b/src/test/java/org/springframework/data/redis/cache/RedisCacheManagerUnitTests.java @@ -68,16 +68,18 @@ public class RedisCacheManagerUnitTests { assertThat(((RedisCache) cm.getCache("other-cache")).getCacheConfiguration()).isEqualTo(withoutPrefix); } - @Test // DATAREDIS-481 + @Test // DATAREDIS-481, DATAREDIS-728 public void predefinedCacheShouldBeCreatedWithSpecificConfig() { RedisCacheConfiguration configuration = RedisCacheConfiguration.defaultCacheConfig().disableKeyPrefix(); RedisCacheManager cm = RedisCacheManager.builder(cacheWriter) - .withInitialCacheConfigurations(Collections.singletonMap("predefined-cache", configuration)).build(); + .withInitialCacheConfigurations(Collections.singletonMap("predefined-cache", configuration)) + .withInitialCacheConfigurations(Collections.singletonMap("another-predefined-cache", configuration)).build(); cm.afterPropertiesSet(); assertThat(((RedisCache) cm.getCache("predefined-cache")).getCacheConfiguration()).isEqualTo(configuration); + assertThat(((RedisCache) cm.getCache("another-predefined-cache")).getCacheConfiguration()).isEqualTo(configuration); assertThat(cm.getMissingCache("new-cache").getCacheConfiguration()).isNotEqualTo(configuration); }