@Test
public void testAsyncException() throws Exception {

  String message = "Something bad happened";
  when(mockFuture.get()).thenThrow(new RuntimeException(message));
  try {
    batch(Arrays.asList(randomPut()));
  } catch (RetriesExhaustedWithDetailsException e) {
    Assert.assertEquals(1, e.getCauses().size());
    Assert.assertEquals(RuntimeException.class, e.getCause(0).getClass());
    Assert.assertEquals(message, e.getCause(0).getMessage());
  }
}