private void createCluster() throws AmbariException {

    clusters.addCluster(clusterName, stack220);
    cluster = clusters.getCluster("c1");

    RepositoryVersionEntity repoVersionEntity = new RepositoryVersionEntity();
    repoVersionEntity.setDisplayName("Initial Version");
    repoVersionEntity.addRepoOsEntities(new ArrayList<>());
    repoVersionEntity.setStack(stackEntity220);
    repoVersionEntity.setVersion("2.2.0.0");
    repoVersionDAO.create(repoVersionEntity);

    helper.getOrCreateRepositoryVersion(stack220, stack220.getStackVersion());
  }
Create a cluster for stack HDP 2.2.0
@throws AmbariException
ambari-server/src/test/java/org/apache/ambari/server/state/services/RetryUpgradeActionServiceTest.java