@Test
public void testExtractRoleName() {

    assertEquals("role1", ZMSUtils.extractRoleName("my-domain1", "my-domain1:role.role1"));
    assertEquals("role1.role2", ZMSUtils.extractRoleName("my-domain1", "my-domain1:role.role1.role2"));
    // invalid roles names
    assertNull(ZMSUtils.extractRoleName("my-domain1", "my-domain1:role1"));
    assertNull(ZMSUtils.extractRoleName("my-domain1", "my-domain2:role.role1"));
    assertNull(ZMSUtils.extractRoleName("my-domain1", "my-domain11:role.role1"));
    assertNull(ZMSUtils.extractRoleName("my-domain1", ":role.role1"));
    assertNull(ZMSUtils.extractRoleName("my-domain1", "role1"));
    assertNull(ZMSUtils.extractRoleName("my-domain1", "role1.role2"));
}