Skip to content

Commit c454f42

Browse files
committed
DATAREDIS-728 - Polishing.
Add tests. Add author tag. Original pull request: #293.
1 parent ecb19f4 commit c454f42

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ protected RedisCache createRedisCache(String name, @Nullable RedisCacheConfigura
215215
*
216216
* @author Christoph Strobl
217217
* @author Mark Strobl
218+
* @author Kezhu Wang
218219
* @since 2.0
219220
*/
220221
public static class RedisCacheManagerBuilder {

src/test/java/org/springframework/data/redis/cache/RedisCacheManagerUnitTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,18 @@ public void appliesDefaultConfigurationToInitialCache() {
6868
assertThat(((RedisCache) cm.getCache("other-cache")).getCacheConfiguration()).isEqualTo(withoutPrefix);
6969
}
7070

71-
@Test // DATAREDIS-481
71+
@Test // DATAREDIS-481, DATAREDIS-728
7272
public void predefinedCacheShouldBeCreatedWithSpecificConfig() {
7373

7474
RedisCacheConfiguration configuration = RedisCacheConfiguration.defaultCacheConfig().disableKeyPrefix();
7575

7676
RedisCacheManager cm = RedisCacheManager.builder(cacheWriter)
77-
.withInitialCacheConfigurations(Collections.singletonMap("predefined-cache", configuration)).build();
77+
.withInitialCacheConfigurations(Collections.singletonMap("predefined-cache", configuration))
78+
.withInitialCacheConfigurations(Collections.singletonMap("another-predefined-cache", configuration)).build();
7879
cm.afterPropertiesSet();
7980

8081
assertThat(((RedisCache) cm.getCache("predefined-cache")).getCacheConfiguration()).isEqualTo(configuration);
82+
assertThat(((RedisCache) cm.getCache("another-predefined-cache")).getCacheConfiguration()).isEqualTo(configuration);
8183
assertThat(cm.getMissingCache("new-cache").getCacheConfiguration()).isNotEqualTo(configuration);
8284
}
8385

0 commit comments

Comments
 (0)