@Test
public void testValidateCommonName() throws IOException {

    Path path = Paths.get("src/test/resources/athenz.instanceid.csr");
    String csr = new String(Files.readAllBytes(path));
    
    X509CertRequest certReq = new X509CertRequest(csr);
    assertNotNull(certReq);
    assertTrue(certReq.validateCommonName("athenz.production"));
    assertEquals(certReq.getCommonName(), "athenz.production");
    
    assertFalse(certReq.validateCommonName("sys.production"));
    assertFalse(certReq.validateCommonName("athenz.storage"));
}