コード例 #1
0
 @Test
 public void redisCacheExplicitWithCaches() {
   load(
       RedisCacheConfiguration.class,
       "spring.cache.type=redis",
       "spring.cache.cacheNames[0]=foo",
       "spring.cache.cacheNames[1]=bar");
   RedisCacheManager cacheManager = validateCacheManager(RedisCacheManager.class);
   assertThat(cacheManager.getCacheNames(), containsInAnyOrder("foo", "bar"));
   assertThat(cacheManager.getCacheNames(), hasSize(2));
 }
コード例 #2
0
 @Test
 public void redisCacheExplicit() {
   load(RedisCacheConfiguration.class, "spring.cache.type=redis");
   RedisCacheManager cacheManager = validateCacheManager(RedisCacheManager.class);
   assertThat(cacheManager.getCacheNames(), empty());
 }