@Test
public void testUpdateX509CertificateSigner() {

    final String caCert = "caCert";
    System.clearProperty(ZTSConsts.ZTS_PROP_X509_CA_CERT_FNAME);
    CertSigner certSigner = Mockito.mock(com.yahoo.athenz.common.server.cert.CertSigner.class);
    when(certSigner.getCACertificate()).thenReturn(caCert);
    InstanceCertManager instanceManager = new InstanceCertManager(null, null, null, false);
    instanceManager.setCertSigner(certSigner);
    // first time our signer was null and we should get back the cert
    instanceManager.resetX509CertificateSigner();
    instanceManager.updateX509CertificateSigner();
    assertEquals("caCert", instanceManager.getX509CertificateSigner());
    // second time it should be a no-op
    instanceManager.updateX509CertificateSigner();
    assertEquals("caCert", instanceManager.getX509CertificateSigner());
    instanceManager.shutdown();
}