@Test
public void testIsConsistentPolicyName() {

    
    Policy policy = new Policy();
    
    policy.setName("domain1:policy.policy1");
    assertTrue(zms.isConsistentPolicyName("domain1", "policy1", policy));
    
    // local name behavior
    
    policy.setName("policy1");
    assertTrue(zms.isConsistentPolicyName("domain1", "policy1", policy));
    assertEquals(policy.getName(), "domain1:policy.policy1");
    
    // inconsistent behavior
    
    policy.setName("domain1:policy.policy1");
    assertFalse(zms.isConsistentPolicyName("domain1", "policy2", policy));
    
    policy.setName("policy1");
    assertFalse(zms.isConsistentPolicyName("domain1", "policy2", policy));
}