@Test
public void testExtractPrincipalServiceName() {

    assertEquals(AthenzUtils.extractPrincipalServiceName("athenz.reader"), "reader");
    assertEquals(AthenzUtils.extractPrincipalServiceName("athenz.api.reader"), "reader");
    assertEquals(AthenzUtils.extractPrincipalServiceName("athenz.api.test.reader"), "reader");
    assertNull(AthenzUtils.extractPrincipalServiceName("athenz"));
    assertNull(AthenzUtils.extractPrincipalServiceName("athenz."));
    assertNull(AthenzUtils.extractPrincipalServiceName(".athenz"));
}