@Test
public void testDeletePolicy() {

    TopLevelDomain dom1 = createTopLevelDomainObject("PolicyDelDom1",
            "Test Domain1", "testOrg", adminUser);
    zms.postTopLevelDomain(mockDomRsrcCtx, auditRef, dom1);
    Policy policy1 = createPolicyObject("PolicyDelDom1", "Policy1");
    zms.putPolicy(mockDomRsrcCtx, "PolicyDelDom1", "Policy1", auditRef, policy1);
    Policy policy2 = createPolicyObject("PolicyDelDom1", "Policy2");
    zms.putPolicy(mockDomRsrcCtx, "PolicyDelDom1", "Policy2", auditRef, policy2);
    Policy policyRes1 = zms.getPolicy(mockDomRsrcCtx, "PolicyDelDom1", "Policy1");
    assertNotNull(policyRes1);
    Policy policyRes2 = zms.getPolicy(mockDomRsrcCtx, "PolicyDelDom1", "Policy2");
    assertNotNull(policyRes2);
    zms.deletePolicy(mockDomRsrcCtx, "PolicyDelDom1", "Policy1", auditRef);
    // we need to get an exception here
    try {
        zms.getPolicy(mockDomRsrcCtx, "PolicyDelDom1", "Policy1");
        fail();
    } catch (Exception ex) {
        assertTrue(true);
    }
    policyRes2 = zms.getPolicy(mockDomRsrcCtx, "PolicyDelDom1", "Policy2");
    assertNotNull(policyRes2);
    zms.deletePolicy(mockDomRsrcCtx, "PolicyDelDom1", "Policy2", auditRef);
    // we need to get an exception here
    try {
        zms.getPolicy(mockDomRsrcCtx, "PolicyDelDom1", "Policy1");
        fail();
    } catch (Exception ex) {
        assertTrue(true);
    }
    // we need to get an exception here
    try {
        zms.getPolicy(mockDomRsrcCtx, "PolicyDelDom1", "Policy2");
        fail();
    } catch (Exception ex) {
        assertTrue(true);
    }
    zms.deleteTopLevelDomain(mockDomRsrcCtx, "PolicyDelDom1", auditRef);
}