Source:
<code>public void testGetAllStoreNoMatchCacheAccessExceptionBeforeLoaderAllFailWithBulkCacheLoadingException() throws Exception { final FakeStore fakeStore = new FakeStore(getEntryMap(KEY_SET_B)); this.store = spy(fakeStore); doThrow(new CacheAccessException("")).when(this.store) .bulkComputeIfAbsent(getAnyStringSet(), getAnyIterableFunction()); final FakeCacheLoaderWriter fakeLoader = new FakeCacheLoaderWriter(TEST_ENTRIES, true); this.loaderWriter = spy(fakeLoader); final Ehcache<String, String> ehcache = this.getEhcache(this.loaderWriter); try { ehcache.getAll(KEY_SET_A); fail(); } catch (BulkCacheLoadingException e) { assertThat(e.getSuccesses().keySet(), empty()); assertThat(e.getFailures().keySet(), Matchers.<Set<?>>equalTo(KEY_SET_A)); } final InOrder ordered = inOrder(this.loaderWriter, this.spiedResilienceStrategy); verify(this.store).bulkComputeIfAbsent(eq(KEY_SET_A), getAnyIterableFunction()); ordered.verify(this.loaderWriter, atLeast(1)).loadAll(this.loadAllCaptor.capture()); assertThat(this.getLoadAllArgs(), equalTo(KEY_SET_A)); ordered.verify(this.spiedResilienceStrategy) .getAllFailure(eq(KEY_SET_A), any(CacheAccessException.class), this.bulkExceptionCaptor.capture()); assertThat(this.bulkExceptionCaptor.getValue().getSuccesses().keySet(), empty()); <START> assertThat(this.bulkExceptionCaptor.getValue().getFailures().keySet(), Matchers.<Set<?>>equalTo(KEY_SET_A)); <END> validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.GetOutcome.class)); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.CacheLoadingOutcome.class)); }</code><technical_language>some duplication caused fact check exception in catch block above. I check exception extract code exception check method: checkBulkLoadingException(BulkCacheLoadingException e, Set<K> successKeys, Set<K> failureKeys)</technical_language>

Target:
public void testGetAllStoreNoMatchCacheAccessExceptionBeforeLoaderAllFailWithBulkCacheLoadingException() throws Exception { final FakeStore fakeStore = new FakeStore(getEntryMap(KEY_SET_B)); this.store = spy(fakeStore); doThrow(new CacheAccessException("")).when(this.store) .bulkComputeIfAbsent(getAnyStringSet(), getAnyIterableFunction()); final FakeCacheLoaderWriter fakeLoader = new FakeCacheLoaderWriter(TEST_ENTRIES, KEY_SET_A, true); this.loaderWriter = spy(fakeLoader); final Ehcache<String, String> ehcache = this.getEhcache(this.loaderWriter); try { ehcache.getAll(KEY_SET_A); fail(); } catch (BulkCacheLoadingException e) { assertThat(e.getSuccesses().keySet(), empty()); assertThat(e.getFailures().keySet(), Matchers.<Set<?>>equalTo(KEY_SET_A)); } final InOrder ordered = inOrder(this.loaderWriter, this.spiedResilienceStrategy); verify(this.store).bulkComputeIfAbsent(eq(KEY_SET_A), getAnyIterableFunction()); ordered.verify(this.loaderWriter, atLeast(1)).loadAll(this.loadAllCaptor.capture()); assertThat(this.getLoadAllArgs(), equalTo(KEY_SET_A)); ordered.verify(this.spiedResilienceStrategy) .getAllFailure(eq(KEY_SET_A), any(CacheAccessException.class), this.bulkExceptionCaptor.capture()); verifyBulkLoadingException(this.bulkExceptionCaptor.getValue(), Collections.<String> emptySet(), KEY_SET_A); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.GetOutcome.class)); validateStats(ehcache, EnumSet.noneOf(CacheOperationOutcomes.CacheLoadingOutcome.class)); }