DATAREDIS-728 - Polishing.

Add tests. Add author tag.

Original pull request: #293.
This commit is contained in:
Mark Paluch
2017-11-16 12:36:13 +01:00
parent 1504c76c2e
commit 1a6f51a7f9
2 changed files with 5 additions and 2 deletions

View File

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