polishing
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user