AuthenticationRequestProcessor { public AuthenticationResponse processRequest(AuthenticationRequest request, OperationalParamsIntf operationalParams, String appFacetId) throws Exception{ AuthenticationResponse response = new AuthenticationResponse(); AuthAssertionBuilder builder = new AuthAssertionBuilder(); Gson gson = new GsonBuilder().create(); response.header = new OperationHeader(); response.header.serverData = request.header.serverData; response.header.op = request.header.op; response.header.upv = request.header.upv; response.header.appID = request.header.appID; FinalChallengeParams fcParams = new FinalChallengeParams(); fcParams.appID = request.header.appID; fcParams.facetID = operationalParams.getFacetId(request.header.appID); fcParams.challenge = request.challenge; response.fcParams = Base64.encodeToString(gson.toJson( fcParams).getBytes(), Base64.URL_SAFE); setAssertions(response,builder, operationalParams, appFacetId); return response; }  AuthenticationResponse processRequest(AuthenticationRequest request, OperationalParamsIntf operationalParams, String appFacetId);  }
@Test public void testProcessRequest() throws Exception { AuthenticationRequestProcessor p = new AuthenticationRequestProcessor(); AuthenticationRequest req = getTestRequest(); AuthenticationResponse resp = p.processRequest(req, operParams, ""); assertNotNull(resp); logger.info(gson.toJson(resp)); }
@Test public void testWithEmptyAppIdProcessRequest() throws Exception { AuthenticationRequestProcessor p = new AuthenticationRequestProcessor(); AuthenticationRequest req = getTestRequestWithEmptyApp(); AuthenticationResponse resp = p.processRequest(req, operParams, ""); assertNotNull(resp); logger.info(gson.toJson(resp)); }