@Test(expected = StoreAccessException.class) public void testConditionalReplaceThrowsOnlySAE() throws Exception { OperationsCodec<Long, String> codec = mock(OperationsCodec.class); ChainResolver chainResolver = mock(ChainResolver.class); ServerStoreProxy serverStoreProxy = mock(ServerStoreProxy.class); when(serverStoreProxy.get(anyLong())).thenThrow(new RuntimeException()); TestTimeSource testTimeSource = mock(TestTimeSource.class); ClusteredStore<Long, String> store = new ClusteredStore<Long, String>(codec, chainResolver, serverStoreProxy, testTimeSource); store.replace(1L, "one", "another one"); }