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);
}
Aggregations