@Test
public void getRestDocument_internalServerError() throws Exception {

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