@Test
  public void testAtlasServerEntityRetryExhausted() throws AtlasServiceException {
    setupConfForRetry();
    AtlasServiceException atlasServiceException = getAtlasServiceException(ClientResponse.Status.BAD_REQUEST);
    AtlasClientV2 atlasClientV2 = mock(AtlasClientV2.class);
    when(atlasClientV2.getServer(Mockito.anyString())).thenThrow(atlasServiceException);
    AtlasRestClient atlasClient = new AtlasRestClientImpl(atlasClientV2, conf);
    try {
      atlasClient.getServer("src", conf);
      Assert.fail("Should have thrown SemanticException.");
    } catch (SemanticException ex) {
      Assert.assertTrue(ex.getMessage().contains("Retry exhausted for retryable error code"));
      Assert.assertTrue(atlasServiceException == ex.getCause());
    }
    ArgumentCaptor<String> getServerReqCaptor = ArgumentCaptor.forClass(String.class);
    verify(atlasClientV2, times(4)).getServer(getServerReqCaptor.capture());
  }
Unit test class for testing Atlas metadata Dump.
ql/src/test/org/apache/hadoop/hive/ql/exec/repl/TestAtlasDumpTask.java