@Test
public void testValidateUriHostname() throws IOException {

    Path path = Paths.get("src/test/resources/athenz.examples.no-uri.pem");
    String pem = new String(Files.readAllBytes(path));
    X509Certificate cert = Crypto.loadX509Certificate(pem);
    assertTrue(zts.validateUriHostname("", null));
    assertTrue(zts.validateUriHostname(null, null));
    assertFalse(zts.validateUriHostname("abc.athenz.com", cert));
    path = Paths.get("src/test/resources/athenz.examples.uri-hostname-only.pem");
    pem = new String(Files.readAllBytes(path));
    cert = Crypto.loadX509Certificate(pem);
    assertTrue(zts.validateUriHostname("abc.athenz.com", cert));
    assertFalse(zts.validateUriHostname("def.athenz.com", cert));
}