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 ecb19f4a8b
commit c454f42b91
2 changed files with 5 additions and 2 deletions

View File

@@ -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 {

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