@Test
public void testExtractServiceName() {

    assertEquals("service1", ZMSUtils.extractServiceName("my-domain1", "my-domain1.service1"));
    assertEquals("service1", ZMSUtils.extractServiceName("my-domain1.domain2", "my-domain1.domain2.service1"));
    // invalid service names
    assertNull(ZMSUtils.extractServiceName("my-domain1", "my-domain1:service1"));
    assertNull(ZMSUtils.extractServiceName("my-domain1", "my-domain2.service1"));
    assertNull(ZMSUtils.extractServiceName("my-domain1", "my-domain11:service.service1"));
    assertNull(ZMSUtils.extractServiceName("my-domain1", ".service1"));
    assertNull(ZMSUtils.extractServiceName("my-domain1", "service1"));
    assertNull(ZMSUtils.extractServiceName("my-domain1", "service1.service2"));
}