@Test
public void testValidateUriHostname() throws IOException {

    Path path = Paths.get("src/test/resources/athenz.examples.uri-instanceid-hostname.csr");
    String csr = new String(Files.readAllBytes(path));
    X509CertRequest certReq = new X509CertRequest(csr);
    assertNotNull(certReq);
    assertTrue(certReq.validateUriHostname("abc.athenz.com"));
    assertFalse(certReq.validateUriHostname(null));
    assertFalse(certReq.validateUriHostname(""));
    assertFalse(certReq.validateUriHostname("def.athenz.com"));
    path = Paths.get("src/test/resources/athenz.examples.uri-hostname-empty.csr");
    csr = new String(Files.readAllBytes(path));
    certReq = new X509CertRequest(csr);
    assertNotNull(certReq);
    assertTrue(certReq.validateUriHostname("abc.athenz.com"));
}