polishing

This commit is contained in:
Stephane Nicoll
2014-05-26 13:39:38 +02:00
parent 05041ff39a
commit bb6e07bd3a
2 changed files with 12 additions and 42 deletions

View File

@@ -34,11 +34,11 @@ import org.junit.rules.ExpectedException;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.AnnotationCacheOperationSource;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.support.SimpleCacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
@@ -172,28 +172,14 @@ public class CacheErrorHandlerTests {
@Configuration
@EnableCaching
static class Config {
@Bean
public CacheInterceptor cacheInterceptor() {
CacheInterceptor cacheInterceptor = new CacheInterceptor();
cacheInterceptor.setCacheManager(cacheManager());
cacheInterceptor.setCacheOperationSources(cacheOperationSource());
cacheInterceptor.setErrorHandler(errorHandler());
return cacheInterceptor;
}
static class Config extends CachingConfigurerSupport {
@Bean
@Override
public CacheErrorHandler errorHandler() {
return mock(CacheErrorHandler.class);
}
@Bean
public CacheOperationSource cacheOperationSource() {
return new AnnotationCacheOperationSource();
}
@Bean
public SimpleService simpleService() {
return new SimpleService();