private void createService(String clusterName, String serviceName,
      RepositoryVersionEntity repositoryVersion, State desiredState)
      throws Exception, AuthorizationException {
    String dStateStr = null;
    if (desiredState != null) {
      dStateStr = desiredState.toString();
    }

    ServiceRequest r1 = new ServiceRequest(clusterName, serviceName,
        repositoryVersion.getId(), dStateStr,
        null);

    Set<ServiceRequest> requests = new HashSet<>();
    requests.add(r1);

    ServiceResourceProviderTest.createServices(controller, repositoryVersionDAO, requests);
  }
Creates a Cluster object, along with its corresponding ClusterVersion based on the stack.
@param clusterName Cluster name
@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java