private Service installService(Cluster cluster, String serviceName,
      RepositoryVersionEntity repositoryVersion) throws AmbariException {
    Service service = null;

    try {
      service = cluster.getService(serviceName);
    } catch (ServiceNotFoundException e) {
      service = serviceFactory.createNew(cluster, serviceName, repositoryVersion);
      cluster.addService(service);
    }

    return service;
  }
Installs a service in the cluster.

@param cluster
@param serviceName
@return
@throws AmbariException
ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ConfigureActionTest.java