Auth { public String auth (String uafMsg, String appFacetId) throws UafMsgProcessException, UafResponseMsgParseException, UafRequestMsgParseException{ logger.info (" [UAF][1]Auth "); AuthenticationRequestProcessor p = new AuthenticationRequestProcessor(); AuthenticationResponse[] ret = new AuthenticationResponse[1]; ret[0] = process(getAuthRequest(uafMsg), p, appFacetId); return getUafProtocolMsg( ret ); }  String auth(String uafMsg, String appFacetId); AuthenticationRequest getAuthRequest(String uafMsg); String getUafProtocolMsg(AuthenticationResponse[] ret); String getUafProtocolMsg(String uafMsg);  }
@Test public void emptyRequest() { InitConfig.getInstance().init(operParams.TEST_AAID, operParams.TestAttestCert, null, operParams, null); try { auth.auth("",""); } catch (UafMsgProcessException e) { fail ("Should have been UafRequestMsgParseException"); } catch (UafResponseMsgParseException e) { fail ("Should have been UafRequestMsgParseException"); } catch (UafRequestMsgParseException e) { assertNotNull(e); } }
@Test public void validRequest() throws Exception { InitConfig.getInstance().init(operParams.TEST_AAID, operParams.TestAttestCert, null, operParams, null); String response = auth.auth(uafMsg,""); assertNotNull(response); }