@Test
public void testGetSSHCertificateSigner() {

    
    SSHSigner sshSigner = Mockito.mock(com.yahoo.athenz.common.server.ssh.SSHSigner.class);
    when(sshSigner.getSignerCertificate(ZTSConsts.ZTS_SSH_HOST)).thenReturn("ssh-host");
    when(sshSigner.getSignerCertificate(ZTSConsts.ZTS_SSH_USER)).thenReturn("ssh-user");
    InstanceCertManager instanceManager = new InstanceCertManager(null, null, null, true);
    instanceManager.setSSHSigner(sshSigner);
    assertEquals(instanceManager.getSSHCertificateSigner("host"), "ssh-host");
    assertEquals(instanceManager.getSSHCertificateSigner("user"), "ssh-user");
    
    // second time we should not fetch from certsigner and use fetched copies
    
    when(sshSigner.getSignerCertificate(ZTSConsts.ZTS_SSH_HOST)).thenReturn(null);
    when(sshSigner.getSignerCertificate(ZTSConsts.ZTS_SSH_USER)).thenReturn(null);
    assertEquals(instanceManager.getSSHCertificateSigner("host"), "ssh-host");
    assertEquals(instanceManager.getSSHCertificateSigner("user"), "ssh-user");
    instanceManager.shutdown();
}