@Test(timeout = 10000)
public void testFormatSchedulerConf() throws Exception {

  try {
    super.setUp();
    GuiceServletConfig.setInjector(
        Guice.createInjector(new WebServletModule()));
    ResourceScheduler scheduler = rm.getResourceScheduler();
    MutableConfigurationProvider provider =
        ((MutableConfScheduler) scheduler).getMutableConfProvider();
    SchedConfUpdateInfo schedUpdateInfo = new SchedConfUpdateInfo();
    HashMap<String, String> globalUpdates = new HashMap<>();
    globalUpdates.put("schedKey1", "schedVal1");
    schedUpdateInfo.setGlobalParams(globalUpdates);
    LogMutation log = provider.logAndApplyMutation(
        UserGroupInformation.getCurrentUser(), schedUpdateInfo);
    rm.getRMContext().getRMAdminService().refreshQueues();
    provider.confirmPendingMutation(log, true);
    Configuration schedulerConf = provider.getConfiguration();
    assertEquals("schedVal1", schedulerConf.get("schedKey1"));
    int exitCode = cli.formatSchedulerConf("", resource());
    assertEquals(0, exitCode);
    schedulerConf = provider.getConfiguration();
    assertNull(schedulerConf.get("schedKey1"));
  } finally {
    cleanUp();
  }
}