@Test
public void testExtractPolicyName() {

    assertEquals("policy1", ZMSUtils.extractPolicyName("my-domain1", "my-domain1:policy.policy1"));
    assertEquals("policy1.policy2", ZMSUtils.extractPolicyName("my-domain1", "my-domain1:policy.policy1.policy2"));
    // invalid policies names
    assertNull(ZMSUtils.extractPolicyName("my-domain1", "my-domain1:policy1"));
    assertNull(ZMSUtils.extractPolicyName("my-domain1", "my-domain2:policy.policy1"));
    assertNull(ZMSUtils.extractPolicyName("my-domain1", "my-domain11:policy.policy1"));
    assertNull(ZMSUtils.extractPolicyName("my-domain1", ":policy.policy1"));
    assertNull(ZMSUtils.extractPolicyName("my-domain1", "policy1"));
    assertNull(ZMSUtils.extractPolicyName("my-domain1", "policy1.policy2"));
}