AuthenticationClient { public SymAuth authenticate() throws AuthenticationException { try { AuthenticationApi authenticationApi = getAuthenticationApi(); authenticationApi.getApiClient().setBasePath(sessionUrl); if (httpClientForSessionToken != null) { Configuration.getDefaultApiClient().setHttpClient(httpClientForSessionToken); } symAuth.setSessionToken(authenticationApi.v1AuthenticatePost()); logger.debug("SessionToken: {} : {}", symAuth.getSessionToken().getName(), symAuth.getSessionToken().getToken()); authenticationApi.getApiClient().setBasePath(keyUrl); if (httpClientForKeyToken != null) { Configuration.getDefaultApiClient().setHttpClient(httpClientForKeyToken); } symAuth.setKeyToken(authenticationApi.v1AuthenticatePost()); logger.debug("KeyToken: {} : {}", symAuth.getKeyToken().getName(), symAuth.getKeyToken().getToken()); } catch (ApiException e) { throw new AuthenticationException("Please check certificates, tokens and paths.. ", e.getCode(), e); } loginStatus = true; return symAuth; } AuthenticationClient(String sessionUrl, String keyUrl);  AuthenticationClient(String sessionUrl, String keyUrl, Client httpClient);  AuthenticationClient(SymphonyClientConfig symphonyClientConfig);  AuthenticationClient(String sessionUrl, String keyUrl, Client httpClientForSessionToken, Client httpClientForKeyToken); SymAuth authenticate(); void sessionLogout(SymAuth symAuth); SymExtensionAppAuth authenticateExtensionApp(String appToken); SymAuth authenticateApp(); SymAuth authenticateAppUser(SymUser symUser, SymAuth symAuth); void setKeystores(String serverTruststore, String truststorePass, String clientKeystore, String keystorePass); boolean isLoggedIn(); Token getKeyToken(); void setKeyToken(Token keyToken); Token getSessionToken(); @SuppressWarnings("unused") void setSessionToken(Token sessionToken);  }
@Test public void authenticate() throws Exception { authenticationClient.setKeystores("/dir/file.trustore","trustpass","/dir/client.keystore","keystorepass"); assertTrue("Verify authenticate..", authenticationClient.authenticate() != null); }