Reg { public String register(String uafMsg, String appFacetId) throws UafMsgProcessException, UafRequestMsgParseException, UafResponseMsgParseException { logger.info(" [UAF][1]Reg "); RegistrationResponse[] ret = new RegistrationResponse[1]; RegistrationResponse regResponse = process(getRegistrationRequest(uafMsg), appFacetId); logger.info(regResponse.assertions[0].assertion); ret[0] = regResponse; return getUafProtocolMsg(ret); }  String register(String uafMsg, String appFacetId); RegistrationResponse process(RegistrationRequest regRequest, String appFacetId); RegistrationRequest getRegistrationRequest(String uafMsg); String getUafProtocolMsg(RegistrationResponse[] ret); String getUafProtocolMsg(String uafMsg);  }
@Test public void emptyUafMsg() { InitConfig.getInstance().init(operParams.TEST_AAID, operParams.TestAttestCert, null, operParams, null); Reg reg = new Reg(); String response = null; try { response = reg.register("",""); } catch (UafMsgProcessException e) { fail(); } catch (UafRequestMsgParseException e) { assertNull(response); } catch (UafResponseMsgParseException e) { fail(); } }
@Test public void validUafMsg() throws UafMsgProcessException, UafRequestMsgParseException, UafResponseMsgParseException { InitConfig.getInstance().init(operParams.TEST_AAID, operParams.TestAttestCert, null, operParams, null); Reg reg = new Reg(); String regRequest = "[{\"header\":{\"upv\":{\"major\":1,\"minor\":0},\"op\":\"Reg\",\"appID\":\"https: String response = reg.register(regRequest,""); assertNotNull(response); }