@Test
  public void testGetEnabledClusterConfigByStack() throws Exception {
    Clusters clusters = injector.getInstance(Clusters.class);
    clusters.addCluster("c1", HDP_01);

    Cluster cluster = clusters.getCluster("c1");

    initClusterEntities();

    Collection<ClusterConfigEntity> latestConfigs = clusterDAO.getEnabledConfigsByStack(
        cluster.getClusterId(), HDP_02);

    Assert.assertEquals(1, latestConfigs.size());
    for (ClusterConfigEntity e : latestConfigs) {
      Assert.assertEquals("version5", e.getTag());
      Assert.assertEquals("oozie-site", e.getType());
    }
  }
Tests that when there are multiple configurations for a stack, only the
selected ones get returned.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/orm/dao/ServiceConfigDAOTest.java