@Test
public void testShutdownService() throws Exception {

  when(mockFuture.get()).thenThrow(new IllegalStateException("closed"));
  try {
    batch(Arrays.asList(randomPut()));
  } catch (RetriesExhaustedWithDetailsException e) {
    Assert.assertEquals(1, e.getCauses().size());
    Assert.assertEquals(IllegalStateException.class, e.getCause(0).getClass());
  }
}