@Test
public void testValidateServiceX509RefreshRequestMismatchPublicKeys() throws IOException {

    ChangeLogStore structStore = new ZMSFileChangeLogStore("/tmp/zts_server_unit_tests/zts_root",
            privateKey, "0");
    
    DataStore store = new DataStore(structStore, null);
    ZTSImpl ztsImpl = new ZTSImpl(mockCloudStore, store);
    Path path = Paths.get("src/test/resources/valid_provider_refresh.csr");
    String csr = new String(Files.readAllBytes(path));
    
    X509CertRequest certReq = new X509CertRequest(csr);
    assertNotNull(certReq);
    certReq.setNormCsrPublicKey("mismatch-public-key");
    
    path = Paths.get("src/test/resources/valid_provider_refresh.pem");
    String pem = new String(Files.readAllBytes(path));
    X509Certificate cert = Crypto.loadX509Certificate(pem);
    
    SimplePrincipal principal = (SimplePrincipal) SimplePrincipal.create("athenz",
            "syncer", "v=S1,d=athenz;n=syncer;s=sig", 0, new CertificateAuthority());
    principal.setX509Certificate(cert);
    assertSame(ztsImpl.validateServiceX509RefreshRequest(principal, certReq, "10.0.0.1"), ServiceX509RefreshRequestStatus.PUBLIC_KEY_MISMATCH);
}