@Test
public void testValidateCSConfigAddALeafQueueValid() throws IOException {

  Configuration oldConfig = CapacitySchedulerConfigGeneratorForTest
          .createBasicCSConfiguration();
  Configuration newConfig = new Configuration(oldConfig);
  newConfig
          .set("yarn.scheduler.capacity.root.queues", "test1, test2, test3");
  newConfig
          .set("yarn.scheduler.capacity.root.test3.state", "RUNNING");
  newConfig
          .set("yarn.scheduler.capacity.root.test3.capacity", "30");
  newConfig
          .set("yarn.scheduler.capacity.root.test1.capacity", "20");
  RMContext rmContext = prepareRMContext();
  Boolean isValidConfig = CapacitySchedulerConfigValidator
          .validateCSConfiguration(oldConfig, newConfig, rmContext);
  Assert.assertTrue(isValidConfig);
}