@Test
public void testAddQueueToALeafQueue() throws IOException {

  Configuration oldConfig = CapacitySchedulerConfigGeneratorForTest
          .createBasicCSConfiguration();
  oldConfig.set("yarn.scheduler.capacity.root.test1.state", "STOPPED");
  Configuration newConfig = new Configuration(oldConfig);
  newConfig.set("yarn.scheduler.capacity.root.test1.queues", "newQueue");
  newConfig
          .set("yarn.scheduler.capacity.root.test1.newQueue.capacity", "100");
  newConfig.set("yarn.scheduler.capacity.queue-mappings",
          "u:test1:test2");
  RMContext rmContext = prepareRMContext();
  boolean isValidConfig = CapacitySchedulerConfigValidator
          .validateCSConfiguration(oldConfig, newConfig, rmContext);
  Assert.assertTrue(isValidConfig);
}