@Test
public void testExtractPrincipalDomainName() {

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