/** * Execute {@link Cache#clear()} on the specified {@link Cache} and * invoke the error handler if an exception occurs. */ protected void doClear(Cache cache) { try { cache.clear(); } catch (RuntimeException ex) { getErrorHandler().handleCacheClearError(ex, cache); } }
/** * Execute {@link Cache#clear()} on the specified {@link Cache} and * invoke the error handler if an exception occurs. */ protected void doClear(Cache cache) { try { cache.clear(); } catch (RuntimeException ex) { getErrorHandler().handleCacheClearError(ex, cache); } }
@Test public void clearFail() { UnsupportedOperationException exception = new UnsupportedOperationException("Test exception on evict"); willThrow(exception).given(this.cache).clear(); this.simpleService.clear(); verify(this.errorHandler).handleCacheClearError(exception, cache); }
@Test public void clearFail() { UnsupportedOperationException exception = new UnsupportedOperationException("Test exception on evict"); willThrow(exception).given(this.cache).clear(); this.simpleService.clear(); verify(this.errorHandler).handleCacheClearError(exception, this.cache); }
/** * Execute {@link Cache#clear()} on the specified {@link Cache} and * invoke the error handler if an exception occurs. */ protected void doClear(Cache cache) { try { cache.clear(); } catch (RuntimeException ex) { getErrorHandler().handleCacheClearError(ex, cache); } }