Search in sources :

Example 1 with Identity

use of com.yahoo.athenz.zts.Identity in project athenz by yahoo.

the class ZTSUtilsTest method testGenerateIdentityFailure.

@Test
public void testGenerateIdentityFailure() throws IOException {
    InstanceCertManager certManager = Mockito.mock(InstanceCertManager.class);
    Mockito.when(certManager.generateX509Certificate(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.anyInt(), Mockito.any())).thenReturn(null);
    Path path = Paths.get("src/test/resources/valid.csr");
    String csr = new String(Files.readAllBytes(path));
    Identity identity = ZTSUtils.generateIdentity(certManager, "aws", "us-west-2", csr, "unknown.syncer", null, 0);
    assertNull(identity);
}
Also used : Path(java.nio.file.Path) InstanceCertManager(com.yahoo.athenz.zts.cert.InstanceCertManager) Identity(com.yahoo.athenz.zts.Identity) Test(org.testng.annotations.Test)

Aggregations

Identity (com.yahoo.athenz.zts.Identity)1 InstanceCertManager (com.yahoo.athenz.zts.cert.InstanceCertManager)1 Path (java.nio.file.Path)1 Test (org.testng.annotations.Test)1