public List<AlertGroupEntity> createDefaultAlertGroups(long clusterId)
      throws Exception {
    AlertGroupEntity hdfsGroup = new AlertGroupEntity();
    hdfsGroup.setDefault(true);
    hdfsGroup.setClusterId(clusterId);
    hdfsGroup.setGroupName("HDFS");
    hdfsGroup.setServiceName("HDFS");

    AlertGroupEntity oozieGroup = new AlertGroupEntity();
    oozieGroup.setDefault(true);
    oozieGroup.setClusterId(clusterId);
    oozieGroup.setGroupName("OOZIE");
    oozieGroup.setServiceName("OOZIE");

    alertDispatchDAO.create(hdfsGroup);
    alertDispatchDAO.create(oozieGroup);

    List<AlertGroupEntity> defaultGroups = alertDispatchDAO.findAllGroups(clusterId);
    assertEquals(2, defaultGroups.size());
    assertNotNull(alertDispatchDAO.findDefaultServiceGroup(clusterId, "HDFS"));
    assertNotNull(alertDispatchDAO.findDefaultServiceGroup(clusterId, "OOZIE"));

    return defaultGroups;
  }
Creates some default alert groups for various services used in the tests.

@param clusterId
@return
@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/orm/OrmTestHelper.java