@Test(timeout = 500)
public void testTransitionToActive() throws Exception {

  String[] args = {"-transitionToActive", "rm1"};
  // RM HA is disabled.
  // transitionToActive should not be executed
  assertEquals(-1, rmAdminCLI.run(args));
  verify(haadmin, never()).transitionToActive(
      any(HAServiceProtocol.StateChangeRequestInfo.class));
  // Now RM HA is enabled.
  // transitionToActive should be executed
  assertEquals(0, rmAdminCLIWithHAEnabled.run(args));
  verify(haadmin).transitionToActive(
      any(HAServiceProtocol.StateChangeRequestInfo.class));
}