@Test
public void testThrottleNoOp() throws Exception {

  final Configuration conf = new Configuration();
  conf.setDouble(DFS_NAMENODE_REENCRYPT_THROTTLE_LIMIT_HANDLER_RATIO_KEY,
      0.5);
  final ReencryptionHandler rh = mockReencryptionhandler(conf);
  // mock StopWatches so all = 30s, locked = 10s. With ratio = .5, throttle
  // should not happen.
  StopWatch mockAll = Mockito.mock(StopWatch.class);
  Mockito.when(mockAll.now()).thenReturn(new Long(30000));
  Mockito.when(mockAll.reset()).thenReturn(mockAll);
  StopWatch mockLocked = Mockito.mock(StopWatch.class);
  Mockito.when(mockLocked.now()).thenReturn(new Long(10000));
  Mockito.when(mockLocked.reset()).thenReturn(mockLocked);
  final BlockingQueue<Runnable> queue = new LinkedBlockingQueue<>();
  Whitebox.setInternalState(rh, "throttleTimerAll", mockAll);
  Whitebox.setInternalState(rh, "throttleTimerLocked", mockLocked);
  Whitebox.setInternalState(rh, "taskQueue", queue);
  final Map<Long, ReencryptionUpdater.ZoneSubmissionTracker>
      submissions = new HashMap<>();
  Whitebox.setInternalState(rh, "submissions", submissions);
  StopWatch sw = new StopWatch().start();
  rh.getTraverser().throttle();
  sw.stop();
  assertTrue("should not have throttled",
      sw.now(TimeUnit.MILLISECONDS) < 1000);
}