private YarnNodeManagerCapacityCalculation getYarnNodeManagerCapacityCalculation()
      throws IllegalAccessException {
    ExecutionCommand executionCommand = new ExecutionCommand();
    Map<String, String> commandParams = new HashMap<>();
    HostRoleCommand hrc = EasyMock.createMock(HostRoleCommand.class);
    YarnNodeManagerCapacityCalculation action = new YarnNodeManagerCapacityCalculation();

    commandParams.put("clusterName", CLUSTER_NAME);
    executionCommand.setCommandParams(commandParams);
    executionCommand.setClusterName(CLUSTER_NAME);

    expect(hrc.getRequestId()).andReturn(1L).anyTimes();
    expect(hrc.getStageId()).andReturn(2L).anyTimes();
    expect(hrc.getExecutionCommandWrapper())
        .andReturn(new ExecutionCommandWrapper(executionCommand)).anyTimes();
    replay(cluster, hrc);

    clusterField.set(action, m_clusters);
    agentConfigsHolderField.set(action, agentConfigsHolder);
    action.setExecutionCommand(executionCommand);
    action.setHostRoleCommand(hrc);
    return action;
  }
Tests upgrade-related server side actions for YarnConfigCalculation
ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/YarnNodeManagerCapacityCalculationTest.java