@Test
public void testPutAssertion() {

    final String domainName = "put-assertion";
    TopLevelDomain dom1 = createTopLevelDomainObject(domainName,
            "Test Domain1", "testOrg", adminUser);
    zms.postTopLevelDomain(mockDomRsrcCtx, auditRef, dom1);
    Policy policy = createPolicyObject(domainName, "policy1");
    zms.putPolicy(mockDomRsrcCtx, domainName, "policy1", auditRef, policy);
    Assertion assertion = new Assertion();
    assertion.setAction("update");
    assertion.setEffect(AssertionEffect.ALLOW);
    assertion.setResource(domainName + ":resource");
    assertion.setRole(ZMSUtils.roleResourceName(domainName, "admin"));
    // add the assertion
    
    assertion = zms.putAssertion(mockDomRsrcCtx, domainName, "policy1", auditRef, assertion);
    
    // verity that the return assertion object has the id set
    
    assertNotNull(assertion.getId());
    
    // validate that both assertions exist
    
    Policy policyRes = zms.getPolicy(mockDomRsrcCtx, domainName, "policy1");
    
    boolean assert1Check = false;
    boolean assert2Check = false;
    for (Assertion testAssert : policyRes.getAssertions()) {
        switch (testAssert.getAction()) {
            case "*":
                assertEquals(testAssert.getResource(), domainName + ":*");
                assert1Check = true;
                break;
            case "update":
                assertEquals(testAssert.getResource(), domainName + ":resource");
                assert2Check = true;
                break;
        }
    }
    assertTrue(assert1Check);
    assertTrue(assert2Check);
    
    zms.deleteTopLevelDomain(mockDomRsrcCtx, domainName, auditRef);
}