@Test
public void getRpcDocument_internalServerError() throws Exception {

  ProxyingDiscoveryService discoveryService = createDiscoveryService(true);
  when(provider.getRpcDocument(SERVER_ROOT, API_NAME, API_VERSION))
      .thenThrow(new InternalServerErrorException(""));
  try {
    discoveryService.getRpcDocument(
        createRequest("discovery/v1/apis/tictactoe/v1/rest"), API_NAME, API_VERSION);
    fail("expected InternalServerErrorException");
  } catch (InternalServerErrorException e) {
    // expected
  }
}