use of org.springframework.cache.interceptor.CacheInterceptor in project spring-framework by spring-projects.
the class AnnotationNamespaceDrivenTests method bothSetOnlyResolverIsUsed.
@Test
public void bothSetOnlyResolverIsUsed() {
ConfigurableApplicationContext context = new GenericXmlApplicationContext("/org/springframework/cache/config/annotationDrivenCacheNamespace-manager-resolver.xml");
CacheInterceptor ci = context.getBean(CacheInterceptor.class);
assertSame(context.getBean("cacheResolver"), ci.getCacheResolver());
context.close();
}
use of org.springframework.cache.interceptor.CacheInterceptor in project spring-framework by spring-projects.
the class CustomInterceptorTests method onlyOneInterceptorIsAvailable.
@Test
public void onlyOneInterceptorIsAvailable() {
Map<String, CacheInterceptor> interceptors = this.ctx.getBeansOfType(CacheInterceptor.class);
assertEquals("Only one interceptor should be defined", 1, interceptors.size());
CacheInterceptor interceptor = interceptors.values().iterator().next();
assertEquals("Custom interceptor not defined", TestCacheInterceptor.class, interceptor.getClass());
}
Aggregations