@Test
public void testExecutePutPolicyMissingAuditRef() {

    // create a new policy without an auditref
    
    String domain = "testreplacepolicymissingauditref";
    TopLevelDomain dom = createTopLevelDomainObject(
        domain, null, null, adminUser);
    dom.setAuditEnabled(true);
    zms.postTopLevelDomain(mockDomRsrcCtx, auditRef, dom);
    Policy policy = createPolicyObject(domain, "policy1");
    try {
        zms.dbService.executePutPolicy(mockDomRsrcCtx, domain, "policy1", policy,
                null, "testExecutePutPolicyMissingAuditRef");
        fail("requesterror not thrown by replacePolicy.");
    } catch (ResourceException ex) {
        assertEquals(400, ex.getCode());
        assertTrue(ex.getMessage().contains("Audit reference required"));
    } finally {
        zms.deleteTopLevelDomain(mockDomRsrcCtx, domain, auditRef);
    }
}