@Test
  public void testActionForCreatingYarnSystemServiceQueue()
      throws Exception {

    Mockito.when(serviceComponent.getServiceComponentsHosts()).thenReturn(hosts);
    Mockito.when(hosts.size()).thenReturn(3);

    YarnNodeManagerCapacityCalculation action = getYarnNodeManagerCapacityCalculation();

    // validate before values
    Cluster c = m_clusters.getCluster(CLUSTER_NAME);

    // Before validation
    Config hbaseEnvConfig =
        c.getDesiredConfigByType(YARN_HBASE_ENV_CONFIG_TYPE);
    validateYarnHBaseEnvProperties(hbaseEnvConfig, false, YARN_DEFAULT_QUEUE);


    Config csConfig =
        c.getDesiredConfigByType(CAPACITY_SCHEDULER_CONFIG_TYPE);
    validateYarnCapacitySchedulerProperties(csConfig, true);

    CommandReport report = action.execute(null);
    assertNotNull(report);

    // After validation
    validateYarnHBaseEnvProperties(hbaseEnvConfig, false, YARN_SYSTEM_SERVICE_QUEUE_NAME);
    validateYarnCapacitySchedulerProperties(csConfig, false);
  }
Tests upgrade-related server side actions for YarnConfigCalculation
ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/YarnNodeManagerCapacityCalculationTest.java