private void testDeleteDefaultGroup(Authentication authentication) throws Exception {
    AlertGroupEntity group = new AlertGroupEntity();
    group.setGroupId(ALERT_GROUP_ID);
    group.setDefault(true);
    group.setGroupName(ALERT_GROUP_NAME);
    group.setAlertDefinitions(getMockDefinitions());
    group.setAlertTargets(getMockTargets());

    resetToStrict(m_dao);
    expect(m_dao.findGroupById(ALERT_GROUP_ID)).andReturn(group).anyTimes();

    replay(m_dao, m_amc, m_clusters, m_cluster);

    SecurityContextHolder.getContext().setAuthentication(authentication);

    AlertGroupResourceProvider provider = createProvider(m_amc);

    Predicate predicate = new PredicateBuilder().property(
        AlertGroupResourceProvider.ALERT_GROUP_CLUSTER_NAME).equals(
        ALERT_GROUP_CLUSTER_NAME).and().property(
        AlertGroupResourceProvider.ALERT_GROUP_ID).equals(
        ALERT_GROUP_ID.toString()).toPredicate();

    provider.deleteResources(new RequestImpl(null, null, null, null), predicate);
    verify(m_dao, m_amc);
  }
Tests that a default group cannot be deleted via the resource provider.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertGroupResourceProviderTest.java