@Before
  public void setup() throws Exception {
    task = new RangerLoadTask(mockClient, conf, work);
    when(mockClient.changeDataSet(Mockito.anyList(), Mockito.anyString(), Mockito.anyString()))
      .thenCallRealMethod();
    when(mockClient.getDenyPolicyForReplicatedDb(Mockito.anyString(), Mockito.anyString(),
      Mockito.anyString())).thenCallRealMethod();
    when(mockClient.checkConnection(Mockito.anyString(), Mockito.any())).thenReturn(true);
    when(work.getMetricCollector()).thenReturn(metricCollector);
  }
Unit test class for testing Ranger Load.
ql/src/test/org/apache/hadoop/hive/ql/exec/repl/TestRangerLoadTask.java