@Test
public void getDirectory_internalServerError() throws Exception {

  CachingDiscoveryProvider provider = createNonExpiringProvider();
  when(delegate.getDirectory(ROOT)).thenThrow(new InternalServerErrorException(""));
  try {
    provider.getDirectory(ROOT);
    fail("expected InternalServerErrorException");
  } catch (InternalServerErrorException e) {
    // expected
  }
}