@Test
public void testDeleteSubDomain() {

    TopLevelDomain dom1 = createTopLevelDomainObject("DelSubDom1",
            "Test Domain1", "testOrg", adminUser);
    zms.postTopLevelDomain(mockDomRsrcCtx, auditRef, dom1);
    SubDomain dom2 = createSubDomainObject("DelSubDom2", "DelSubDom1",
            "Test Domain2", "testOrg", adminUser);
    zms.postSubDomain(mockDomRsrcCtx, "DelSubDom1", auditRef, dom2);
    Domain resDom1 = zms.getDomain(mockDomRsrcCtx, "DelSubDom1.DelSubDom2");
    assertNotNull(resDom1);
    zms.deleteSubDomain(mockDomRsrcCtx, "DelSubDom1", "DelSubDom2", auditRef);
    // we should get a forbidden exception since the domain
    // no longer exists
    try {
        zms.getDomain(mockDomRsrcCtx, "DelSubDom1.DelSubDom2");
        fail();
    } catch (Exception ex) {
        assertTrue(true);
    }
    zms.deleteTopLevelDomain(mockDomRsrcCtx, "DelSubDom1", auditRef);
}