@Test
public void testVerifyCertificateRequest() throws IOException {

    
    Path path = Paths.get("src/test/resources/athenz.instanceid.csr");
    String csr = new String(Files.readAllBytes(path));
    
    X509CertRecord certRecord = new X509CertRecord();
    certRecord.setService("athenz.production");
    certRecord.setInstanceId("1001");
    
    PKCS10CertificationRequest certReq = Crypto.getPKCS10CertRequest(csr);
    boolean result = ZTSUtils.verifyCertificateRequest(certReq, "athenz", "production", certRecord);
    assertTrue(result);
    
    certRecord.setService("athenz.production");
    certRecord.setInstanceId("1001");
    result = ZTSUtils.verifyCertificateRequest(certReq, "athenz2", "production", certRecord);
    assertFalse(result);
    
    certRecord.setService("athenz2.production");
    certRecord.setInstanceId("1001");
    result = ZTSUtils.verifyCertificateRequest(certReq, "athenz", "production", certRecord);
    assertFalse(result);
    
    certRecord.setService("athenz.production");
    certRecord.setInstanceId("1002");
    result = ZTSUtils.verifyCertificateRequest(certReq, "athenz", "production", certRecord);
    assertFalse(result);
}