@Override @Bean public CacheErrorHandler errorHandler() { return new SimpleCacheErrorHandler(); }
@Override public void handleCacheEvictError ( RuntimeException exception , Cache cache , Object key ) { LogUtils.getLogger().error( "cache : {} , key : {}" , cache , key ); LogUtils.getLogger().error( "handleCacheEvictError" , exception ); super.handleCacheEvictError( exception , cache , key ); }
@Override public void handleCacheGetError ( RuntimeException exception , Cache cache , Object key ) { LogUtils.getLogger().error( "cache : {} , key : {}" , cache , key ); LogUtils.getLogger().error( "handleCacheGetError" , exception ); super.handleCacheGetError( exception , cache , key ); }
@Override public void handleCachePutError ( RuntimeException exception , Cache cache , Object key , Object value ) { LogUtils.getLogger().error( "cache : {} , key : {} , value : {} " , cache , key , value ); LogUtils.getLogger().error( "handleCachePutError" , exception ); super.handleCachePutError( exception , cache , key , value ); }
@Override public void handleCacheClearError ( RuntimeException exception , Cache cache ) { LogUtils.getLogger().error( "cache : {} " , cache ); LogUtils.getLogger().error( "handleCacheClearError" , exception ); super.handleCacheClearError( exception , cache ); } };
@Override @Bean public CacheErrorHandler errorHandler() { return new SimpleCacheErrorHandler(); }
@Override @Bean public CacheErrorHandler errorHandler() { return new SimpleCacheErrorHandler(); }
@Override @Bean public CacheErrorHandler errorHandler() { return new SimpleCacheErrorHandler(); }
@Test public void getFailProperException() { UnsupportedOperationException exception = new UnsupportedOperationException("Test exception on get"); willThrow(exception).given(this.cache).get(0L); this.cacheInterceptor.setErrorHandler(new SimpleCacheErrorHandler()); this.thrown.expect(is(exception)); this.simpleService.get(0L); }
@Test public void evictFailProperException() { UnsupportedOperationException exception = new UnsupportedOperationException("Test exception on evict"); willThrow(exception).given(this.cache).evict(0L); this.cacheInterceptor.setErrorHandler(new SimpleCacheErrorHandler()); this.thrown.expect(is(exception)); this.simpleService.evict(0L); }
@Test public void clearFailProperException() { UnsupportedOperationException exception = new UnsupportedOperationException("Test exception on evict"); willThrow(exception).given(this.cache).clear(); this.cacheInterceptor.setErrorHandler(new SimpleCacheErrorHandler()); this.thrown.expect(is(exception)); this.simpleService.clear(); }
@Test public void putFailProperException() { UnsupportedOperationException exception = new UnsupportedOperationException("Test exception on put"); willThrow(exception).given(this.cache).put(0L, 0L); this.cacheInterceptor.setErrorHandler(new SimpleCacheErrorHandler()); this.thrown.expect(is(exception)); this.simpleService.put(0L); }
@Override public CacheErrorHandler errorHandler() { return new SimpleCacheErrorHandler(); }
/** * Factory method for create the new {@link SimpleCacheErrorHandler} object. * * @return the new {@link SimpleCacheErrorHandler} */ public static CacheErrorHandler newSimpleCacheErrorHandler() { return new SimpleCacheErrorHandler(); }
@Bean @Override public CacheErrorHandler errorHandler() { return new SimpleCacheErrorHandler(); }
@Bean @Override public CacheErrorHandler errorHandler() { return new SimpleCacheErrorHandler(); }