Search in sources :

Example 11 with CertSigner

use of com.yahoo.athenz.common.server.cert.CertSigner in project athenz by yahoo.

the class InstanceCertManagerTest method testGenerateIdentityNullCert.

@Test
public void testGenerateIdentityNullCert() {
    CertSigner certSigner = Mockito.mock(com.yahoo.athenz.common.server.cert.CertSigner.class);
    Mockito.when(certSigner.generateX509Certificate(Mockito.<String>any(), Mockito.any(), Mockito.anyInt())).thenReturn(null);
    InstanceCertManager instanceManager = new InstanceCertManager(null, certSigner);
    InstanceIdentity identity = instanceManager.generateIdentity("csr", "cn", null, 0);
    assertNull(identity);
}
Also used : CertSigner(com.yahoo.athenz.common.server.cert.CertSigner) InstanceIdentity(com.yahoo.athenz.zts.InstanceIdentity) Test(org.testng.annotations.Test)

Aggregations

CertSigner (com.yahoo.athenz.common.server.cert.CertSigner)11 Test (org.testng.annotations.Test)11 InstanceIdentity (com.yahoo.athenz.zts.InstanceIdentity)6 SimplePrincipal (com.yahoo.athenz.auth.impl.SimplePrincipal)2 SelfCertSigner (com.yahoo.athenz.zts.cert.impl.SelfCertSigner)2 Path (java.nio.file.Path)2 Principal (com.yahoo.athenz.auth.Principal)1 PrincipalAuthority (com.yahoo.athenz.auth.impl.PrincipalAuthority)1 SignedDomain (com.yahoo.athenz.zms.SignedDomain)1 Identity (com.yahoo.athenz.zts.Identity)1 HttpCertSigner (com.yahoo.athenz.zts.cert.impl.HttpCertSigner)1 HttpCertSignerFactory (com.yahoo.athenz.zts.cert.impl.HttpCertSignerFactory)1 ChangeLogStore (com.yahoo.athenz.zts.store.ChangeLogStore)1 CloudStore (com.yahoo.athenz.zts.store.CloudStore)1 DataStore (com.yahoo.athenz.zts.store.DataStore)1 MockCloudStore (com.yahoo.athenz.zts.store.MockCloudStore)1 MockZMSFileChangeLogStore (com.yahoo.athenz.zts.store.impl.MockZMSFileChangeLogStore)1 ZMSFileChangeLogStore (com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore)1 File (java.io.File)1 IOException (java.io.IOException)1