@Test public void testAuthenticate() throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException, RemoteApiException { String certDir = mockKeyStore(); String keystore = certDir + KEYSTORE; service.authenticate(DEFAULT_USER_ID, TRUSTSTORE, TRUSTSTORE_PASSWORD, KEYSTORE_TYPE, keystore, KEYSTORE_PASSWORD, KEYSTORE_TYPE); verify(authenticationProxy, times(1)).authenticate(DEFAULT_USER_ID); assertEquals(TRUSTSTORE, System.getProperty(TRUSTSTORE_PROP)); assertEquals(TRUSTSTORE_PASSWORD, System.getProperty(TRUSTSTORE_PASSWORD_PROP)); assertEquals(KEYSTORE_TYPE, System.getProperty(TRUSTSTORE_TYPE_PROP)); }
public void authenticate(String userId, String trustStore, String trustStorePassword, String trustStoreType, String keystore, String keyStorePassword, String keyStoreType) { try { setupSSLContext(userId, trustStore, trustStorePassword, trustStoreType, keystore, keyStorePassword, keyStoreType); authenticationProxy.authenticate(userId); } catch (AuthenticationException e) { String message = logMessage.getMessage(FAIL_AUTH_API); String solution = logMessage.getMessage(FAIL_AUTH_API_SOLUTION); throw new IntegrationProvisioningAuthException(message, e, solution); } }
AuthenticationService { public void authenticate(String userId, String trustStore, String trustStorePassword, String trustStoreType, String keystore, String keyStorePassword, String keyStoreType) { try { setupSSLContext(userId, trustStore, trustStorePassword, trustStoreType, keystore, keyStorePassword, keyStoreType); authenticationProxy.authenticate(userId); } catch (AuthenticationException e) { String message = logMessage.getMessage(FAIL_AUTH_API); String solution = logMessage.getMessage(FAIL_AUTH_API_SOLUTION); throw new IntegrationProvisioningAuthException(message, e, solution); } } }
AuthenticationService { public void authenticate(String userId, String trustStore, String trustStorePassword, String trustStoreType, String keystore, String keyStorePassword, String keyStoreType) { try { setupSSLContext(userId, trustStore, trustStorePassword, trustStoreType, keystore, keyStorePassword, keyStoreType); authenticationProxy.authenticate(userId); } catch (AuthenticationException e) { String message = logMessage.getMessage(FAIL_AUTH_API); String solution = logMessage.getMessage(FAIL_AUTH_API_SOLUTION); throw new IntegrationProvisioningAuthException(message, e, solution); } }  }
AuthenticationService { public void authenticate(String userId, String trustStore, String trustStorePassword, String trustStoreType, String keystore, String keyStorePassword, String keyStoreType) { try { setupSSLContext(userId, trustStore, trustStorePassword, trustStoreType, keystore, keyStorePassword, keyStoreType); authenticationProxy.authenticate(userId); } catch (AuthenticationException e) { String message = logMessage.getMessage(FAIL_AUTH_API); String solution = logMessage.getMessage(FAIL_AUTH_API_SOLUTION); throw new IntegrationProvisioningAuthException(message, e, solution); } }  void authenticate(String userId, String trustStore, String trustStorePassword,
      String trustStoreType, String keystore, String keyStorePassword, String keyStoreType); }
AuthenticationService { public void authenticate(String userId, String trustStore, String trustStorePassword, String trustStoreType, String keystore, String keyStorePassword, String keyStoreType) { try { setupSSLContext(userId, trustStore, trustStorePassword, trustStoreType, keystore, keyStorePassword, keyStoreType); authenticationProxy.authenticate(userId); } catch (AuthenticationException e) { String message = logMessage.getMessage(FAIL_AUTH_API); String solution = logMessage.getMessage(FAIL_AUTH_API_SOLUTION); throw new IntegrationProvisioningAuthException(message, e, solution); } }  void authenticate(String userId, String trustStore, String trustStorePassword,
      String trustStoreType, String keystore, String keyStorePassword, String keyStoreType);  }