@Test
  public void testRetryingClientTimeBased() throws SemanticException, IOException, AtlasServiceException {
    AtlasClientV2 atlasClientV2 = mock(AtlasClientV2.class);
    AtlasExportRequest exportRequest = mock(AtlasExportRequest.class);
    String exportResponseData = "dumpExportContent";
    InputStream exportedMetadataIS = new ByteArrayInputStream(exportResponseData.getBytes(StandardCharsets.UTF_8));
    when(atlasClientV2.exportData(any(AtlasExportRequest.class))).thenReturn(exportedMetadataIS);
    when(exportRequest.toString()).thenReturn("dummyExportRequest");
    when(conf.getTimeVar(HiveConf.ConfVars.REPL_RETRY_TOTAL_DURATION, TimeUnit.SECONDS)).thenReturn(60L);
    when(conf.getTimeVar(HiveConf.ConfVars.REPL_RETRY_INTIAL_DELAY, TimeUnit.SECONDS)).thenReturn(1L);
    AtlasRestClient atlasClient = new AtlasRestClientImpl(atlasClientV2, conf);
    AtlasRestClientImpl atlasRestClientImpl = (AtlasRestClientImpl)atlasClient;
    InputStream inputStream = atlasRestClientImpl.exportData(exportRequest);
    ArgumentCaptor<AtlasExportRequest> expReqCaptor = ArgumentCaptor.forClass(AtlasExportRequest.class);
    verify(atlasClientV2, times(1)).exportData(expReqCaptor.capture());
    Assert.assertEquals(expReqCaptor.getValue().toString(), "dummyExportRequest");
    byte[] exportResponseDataReadBytes = new byte[exportResponseData.length()];
    inputStream.read(exportResponseDataReadBytes);
    String exportResponseDataReadString = new String(exportResponseDataReadBytes, StandardCharsets.UTF_8);
    Assert.assertEquals(exportResponseData, exportResponseDataReadString);
  }
Unit test class for testing Atlas metadata Dump.
ql/src/test/org/apache/hadoop/hive/ql/exec/repl/TestAtlasDumpTask.java