@Test
  public void testGetFileAsListRetry() throws Exception {
    AtlasRequestBuilder atlasRequestBuilder = Mockito.spy(AtlasRequestBuilder.class);
    FileSystem fs = Mockito.mock(FileSystem.class);
    Mockito.doReturn(fs).when(atlasRequestBuilder).getFileSystem(any(Path.class), any(HiveConf.class));
    when(fs.getFileStatus(any(Path.class))).thenThrow(new IOException("Unable to connect"));
    Path tableListPath = new Path("/tmp/list");
    AtlasReplInfo atlasReplInfo = new AtlasReplInfo("http://localhost:31000", "srcDb", "tgtDb",
            "src","tgt", new Path("/tmp/staging"), tableListPath, conf);
    setupConfForRetry();
    try {
      atlasRequestBuilder.createExportRequest(atlasReplInfo);
    } catch (Exception e) {
      Assert.assertEquals(SemanticException.class.getName(), e.getClass().getName());
      Assert.assertTrue(e.getMessage().contains("Unable to connect"));
    }
    ArgumentCaptor<Path> getServerReqCaptor = ArgumentCaptor.forClass(Path.class);
    verify(fs, times(4)).getFileStatus(getServerReqCaptor.capture());
    List<Path>  pathList = getServerReqCaptor.getAllValues();
    for (Path path: pathList) {
      Assert.assertTrue(tableListPath.equals(path));
    }
  }
Unit test class for testing Atlas metadata Dump.
ql/src/test/org/apache/hadoop/hive/ql/exec/repl/TestAtlasDumpTask.java