@Test
  public void testSuccessValidAuthProviderEndpoint() throws Exception {
    RangerExportPolicyList rangerPolicyList = new RangerExportPolicyList();
    rangerPolicyList.setPolicies(new ArrayList<RangerPolicy>());
    when(mockClient.exportRangerPolicies(Mockito.anyString(), Mockito.anyString(), Mockito.anyString(),
      Mockito.any()))
      .thenReturn(rangerPolicyList);
    when(conf.get(RANGER_REST_URL)).thenReturn("rangerEndpoint");
    when(conf.get(RANGER_HIVE_SERVICE_NAME)).thenReturn("hive");
    when(work.getDbName()).thenReturn("testdb");
    when(work.getCurrentDumpPath()).thenReturn(new Path("/tmp"));
    when(work.getRangerConfigResource()).thenReturn(new URL("file://ranger.xml"));
    int status = task.execute();
    Assert.assertEquals(0, status);
  }
Unit test class for testing Ranger Dump.
ql/src/test/org/apache/hadoop/hive/ql/exec/repl/TestRangerDumpTask.java