use of org.springframework.cache.interceptor.CacheInterceptor in project spring-framework by spring-projects.
the class EnableCachingTests method bothSetOnlyResolverIsUsed.
@Test
public void bothSetOnlyResolverIsUsed() {
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(FullCachingConfig.class);
CacheInterceptor ci = context.getBean(CacheInterceptor.class);
assertSame(context.getBean("cacheResolver"), ci.getCacheResolver());
assertSame(context.getBean("keyGenerator"), ci.getKeyGenerator());
context.close();
}
use of org.springframework.cache.interceptor.CacheInterceptor in project spring-framework by spring-projects.
the class EnableCachingTests method testKeyStrategy.
@Test
public void testKeyStrategy() {
CacheInterceptor ci = this.ctx.getBean(CacheInterceptor.class);
assertSame(this.ctx.getBean("keyGenerator", KeyGenerator.class), ci.getKeyGenerator());
}
use of org.springframework.cache.interceptor.CacheInterceptor in project spring-framework by spring-projects.
the class EnableCachingTests method emptyConfigSupport.
@Test
public void emptyConfigSupport() {
ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(EmptyConfigSupportConfig.class);
CacheInterceptor ci = context.getBean(CacheInterceptor.class);
assertNotNull(ci.getCacheResolver());
assertEquals(SimpleCacheResolver.class, ci.getCacheResolver().getClass());
assertSame(context.getBean(CacheManager.class), ((SimpleCacheResolver) ci.getCacheResolver()).getCacheManager());
context.close();
}
use of org.springframework.cache.interceptor.CacheInterceptor in project spring-framework by spring-projects.
the class AnnotationNamespaceDrivenTests method testCacheErrorHandler.
@Test
public void testCacheErrorHandler() {
CacheInterceptor ci = this.ctx.getBean("org.springframework.cache.interceptor.CacheInterceptor#0", CacheInterceptor.class);
assertSame(this.ctx.getBean("errorHandler", CacheErrorHandler.class), ci.getErrorHandler());
}
use of org.springframework.cache.interceptor.CacheInterceptor in project spring-framework by spring-projects.
the class CacheAdviceNamespaceTests method testKeyStrategy.
@Test
public void testKeyStrategy() throws Exception {
CacheInterceptor bean = this.ctx.getBean("cacheAdviceClass", CacheInterceptor.class);
Assert.assertSame(this.ctx.getBean("keyGenerator"), bean.getKeyGenerator());
}
Aggregations