@Test
public void testValidateRoleCertificateRequestMismatchIP() throws IOException {

    Path path = Paths.get("src/test/resources/role_single_ip.csr");
    String csr = new String(Files.readAllBytes(path));
    path = Paths.get("src/test/resources/athenz.instanceid.pem");
    String pem = new String(Files.readAllBytes(path));
    X509Certificate cert = Crypto.loadX509Certificate(pem);
    Set<String> roles = new HashSet<>();
    roles.add("writers");
    // disable IP validation and we should get success
    zts.verifyCertRequestIP = false;
    zts.validCertSubjectOrgValues = null;
    assertTrue(zts.validateRoleCertificateRequest(csr, "athenz", roles, "athenz.production",
            null, cert, "10.11.12.13"));
    assertTrue(zts.validateRoleCertificateRequest(csr, "athenz", roles, "athenz.production",
            null, cert, "10.11.12.14"));
    // enable validation and the mismatch one should fail
    zts.verifyCertRequestIP = true;
    assertTrue(zts.validateRoleCertificateRequest(csr, "athenz", roles, "athenz.production",
            null, cert, "10.11.12.13"));
    assertFalse(zts.validateRoleCertificateRequest(csr, "athenz", roles, "athenz.production",
            null, cert, "10.11.12.14"));
}