@Test
public void testConstructorValidUriHostname() 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(new String(Files.readAllBytes(path)));
    assertNotNull(certReq);
    StringBuilder errorMsg = new StringBuilder(256);
    assertEquals(certReq.getUriHostname(), "abc.athenz.com");
    path = Paths.get("src/test/resources/athenz.examples.uri-hostname-only.csr");
    csr = new String(Files.readAllBytes(path));
    certReq = new X509CertRequest(csr);
    assertNotNull(certReq);
    assertEquals(certReq.getUriHostname(), "abc.athenz.com");
}