@Test(expectedExceptions = AuthException.class) public void getRedirectUriTestFailToRegister() throws Throwable { doReturn(authClientHandler).when(authOIDCClient).getClientHandler(eq(userName), eq(password)); doThrow(new AuthException("Failed to build URI.")) .when(authClientHandler) .registerImplicitClient(eq(loginRedirectUri), eq(logoutRedirectUri)); AuthHelper authHelper = new AuthHelper(); authHelper.getResourceLoginUri(authOIDCClient, userName, password, loginRedirectEndpoint, logoutRedirectEndpoint); verify(authOIDCClient, times(1)).getClientHandler(userName, password); verify(authClientHandler, times(1)).registerImplicitClient(eq(loginRedirectUri), eq(logoutRedirectUri)); }
public AuthClientHandler.ImplicitClient getResourceLoginUri( String tenant, String user, String password, String authServerAddress, int authServerPort, String loginRedirectEndpoint, String logoutRedirectEndpoint) throws AuthException, NoSuchAlgorithmException, CertificateException, OperatorCreationException, URISyntaxException { AuthOIDCClient oidcClient = new AuthOIDCClient(authServerAddress, authServerPort, tenant); return getResourceLoginUri(oidcClient, user, password, loginRedirectEndpoint, logoutRedirectEndpoint); }
AuthHelper { public AuthClientHandler.ImplicitClient getResourceLoginUri( String tenant, String user, String password, String authServerAddress, int authServerPort, String loginRedirectEndpoint, String logoutRedirectEndpoint) throws AuthException, NoSuchAlgorithmException, CertificateException, OperatorCreationException, URISyntaxException { AuthOIDCClient oidcClient = new AuthOIDCClient(authServerAddress, authServerPort, tenant); return getResourceLoginUri(oidcClient, user, password, loginRedirectEndpoint, logoutRedirectEndpoint); } }
AuthHelper { public AuthClientHandler.ImplicitClient getResourceLoginUri( String tenant, String user, String password, String authServerAddress, int authServerPort, String loginRedirectEndpoint, String logoutRedirectEndpoint) throws AuthException, NoSuchAlgorithmException, CertificateException, OperatorCreationException, URISyntaxException { AuthOIDCClient oidcClient = new AuthOIDCClient(authServerAddress, authServerPort, tenant); return getResourceLoginUri(oidcClient, user, password, loginRedirectEndpoint, logoutRedirectEndpoint); }  }
AuthHelper { public AuthClientHandler.ImplicitClient getResourceLoginUri( String tenant, String user, String password, String authServerAddress, int authServerPort, String loginRedirectEndpoint, String logoutRedirectEndpoint) throws AuthException, NoSuchAlgorithmException, CertificateException, OperatorCreationException, URISyntaxException { AuthOIDCClient oidcClient = new AuthOIDCClient(authServerAddress, authServerPort, tenant); return getResourceLoginUri(oidcClient, user, password, loginRedirectEndpoint, logoutRedirectEndpoint); }  AuthClientHandler.ImplicitClient getResourceLoginUri(
      String tenant, String user, String password, String authServerAddress, int authServerPort,
      String loginRedirectEndpoint, String logoutRedirectEndpoint); AuthClientHandler.ImplicitClient getResourceLoginUri(
      AuthOIDCClient oidcClient, String user, String password,
      String loginRedirectEndpoint, String logoutRedirectEndpoint); }
AuthHelper { public AuthClientHandler.ImplicitClient getResourceLoginUri( String tenant, String user, String password, String authServerAddress, int authServerPort, String loginRedirectEndpoint, String logoutRedirectEndpoint) throws AuthException, NoSuchAlgorithmException, CertificateException, OperatorCreationException, URISyntaxException { AuthOIDCClient oidcClient = new AuthOIDCClient(authServerAddress, authServerPort, tenant); return getResourceLoginUri(oidcClient, user, password, loginRedirectEndpoint, logoutRedirectEndpoint); }  AuthClientHandler.ImplicitClient getResourceLoginUri(
      String tenant, String user, String password, String authServerAddress, int authServerPort,
      String loginRedirectEndpoint, String logoutRedirectEndpoint); AuthClientHandler.ImplicitClient getResourceLoginUri(
      AuthOIDCClient oidcClient, String user, String password,
      String loginRedirectEndpoint, String logoutRedirectEndpoint);  }