use of org.springframework.cache.ehcache.EhCacheCacheManager in project spring-boot by spring-projects.
the class CacheAutoConfigurationTests method ehcacheCacheWithCaches.
@Test
public void ehcacheCacheWithCaches() {
load(DefaultCacheConfiguration.class, "spring.cache.type=ehcache");
EhCacheCacheManager cacheManager = validateCacheManager(EhCacheCacheManager.class);
assertThat(cacheManager.getCacheNames()).containsOnly("cacheTest1", "cacheTest2");
assertThat(this.context.getBean(net.sf.ehcache.CacheManager.class)).isEqualTo(cacheManager.getCacheManager());
}
use of org.springframework.cache.ehcache.EhCacheCacheManager in project spring-boot by spring-projects.
the class CacheAutoConfigurationTests method ehcacheCacheWithExistingCacheManager.
@Test
public void ehcacheCacheWithExistingCacheManager() {
load(EhCacheCustomCacheManager.class, "spring.cache.type=ehcache");
EhCacheCacheManager cacheManager = validateCacheManager(EhCacheCacheManager.class);
assertThat(cacheManager.getCacheManager()).isEqualTo(this.context.getBean("customEhCacheCacheManager"));
}
use of org.springframework.cache.ehcache.EhCacheCacheManager in project spring-boot by spring-projects.
the class CacheAutoConfigurationTests method ehcacheCacheWithConfig.
@Test
public void ehcacheCacheWithConfig() {
load(DefaultCacheConfiguration.class, "spring.cache.type=ehcache", "spring.cache.ehcache.config=cache/ehcache-override.xml");
EhCacheCacheManager cacheManager = validateCacheManager(EhCacheCacheManager.class);
assertThat(cacheManager.getCacheNames()).containsOnly("cacheOverrideTest1", "cacheOverrideTest2");
}
Aggregations