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); }