@Test(expected = KeyPairException.class) public void testFailGenerateCSR() throws IOException, InterruptedException { Application application = getApplication(false); IntegrationSettings settings = new IntegrationSettings(); settings.setUsername(MOCK_APP_TYPE); doReturn(0).when(process).exitValue(); doReturn(0).doThrow(IOException.class).when(process).waitFor(); keyPairService.exportCertificate(settings, application); }
public void exportCertificate(IntegrationSettings settings, Application application) { if (shouldGenerateCertificate()) { String keyFileName = generatePrivateKey(application); String reqFileName = generateCSR(settings.getUsername(), application, keyFileName); generateCertificate(application, keyFileName, reqFileName); } }
UserKeyPairService extends KeyPairService { public void exportCertificate(IntegrationSettings settings, Application application) { if (shouldGenerateCertificate()) { String keyFileName = generatePrivateKey(application); String reqFileName = generateCSR(settings.getUsername(), application, keyFileName); generateCertificate(application, keyFileName, reqFileName); } } }
UserKeyPairService extends KeyPairService { public void exportCertificate(IntegrationSettings settings, Application application) { if (shouldGenerateCertificate()) { String keyFileName = generatePrivateKey(application); String reqFileName = generateCSR(settings.getUsername(), application, keyFileName); generateCertificate(application, keyFileName, reqFileName); } } UserKeyPairService(ApplicationArguments args, LogMessageSource logMessage,
      IntegrationProperties properties, IntegrationUtils utils); }
UserKeyPairService extends KeyPairService { public void exportCertificate(IntegrationSettings settings, Application application) { if (shouldGenerateCertificate()) { String keyFileName = generatePrivateKey(application); String reqFileName = generateCSR(settings.getUsername(), application, keyFileName); generateCertificate(application, keyFileName, reqFileName); } } UserKeyPairService(ApplicationArguments args, LogMessageSource logMessage,
      IntegrationProperties properties, IntegrationUtils utils); void exportCertificate(IntegrationSettings settings, Application application); }
UserKeyPairService extends KeyPairService { public void exportCertificate(IntegrationSettings settings, Application application) { if (shouldGenerateCertificate()) { String keyFileName = generatePrivateKey(application); String reqFileName = generateCSR(settings.getUsername(), application, keyFileName); generateCertificate(application, keyFileName, reqFileName); } } UserKeyPairService(ApplicationArguments args, LogMessageSource logMessage,
      IntegrationProperties properties, IntegrationUtils utils); void exportCertificate(IntegrationSettings settings, Application application);  }