XDRPolicyTransformHelper { public CheckPolicyRequestType transformXDRResponseToCheckPolicy(XDRResponseEventType event) { LOG.debug("Begin -- XDRPolicyTransformHelper.transformXDRResponseToCheckPolicy()"); CheckPolicyRequestType checkPolicyRequest = null; if (event == null) { LOG.debug("Request is null."); return checkPolicyRequest; } else { checkPolicyRequest = new CheckPolicyRequestType(); } RequestType request = new RequestType(); SubjectHelper subjHelp = new SubjectHelper(); SubjectType subject = subjHelp.subjectFactory(event.getSendingHomeCommunity(), event.getMessage().getAssertion()); LOG.debug("transformXDRResponseToCheckPolicy - adding subject"); request.getSubject().add(subject); LOG.debug("transformXDRResponseToCheckPolicy - adding assertion data"); AssertionHelper assertHelp = new AssertionHelper(); assertHelp.appendAssertionDataToRequest(request, event.getMessage().getAssertion()); if (NhincConstants.POLICYENGINE_OUTBOUND_DIRECTION.equals(event.getDirection())) { request.setAction(ActionHelper.actionFactory(XDRRESPONSE_ACTION_OUT_VALUE)); } else if (NhincConstants.POLICYENGINE_INBOUND_DIRECTION.equals(event.getDirection())) { request.setAction(ActionHelper.actionFactory(XDRRESPONSE_ACTION_IN_VALUE)); } checkPolicyRequest.setRequest(request); checkPolicyRequest.setAssertion(event.getMessage().getAssertion()); LOG.debug("End -- XDRPolicyTransformHelper.transformXDRResponseToCheckPolicy()"); return checkPolicyRequest; }  CheckPolicyRequestType transformXDRToCheckPolicy(XDREventType event); CheckPolicyRequestType transformXDREntityToCheckPolicy(
        RespondingGatewayProvideAndRegisterDocumentSetSecuredRequestType request); CheckPolicyRequestType transformXDRResponseToCheckPolicy(XDRResponseEventType event);  }
@Test public void testTransformXDRResponseToCheckPolicy() throws Exception { XDRResponseEventType eventA = new XDRResponseEventType(); assertionType.setMessageId(MESSAGE_ID); pnt.setFullName("Minh"); assertionType.setPersonName(pnt); rsl.getSlot().add(slotType1); sor.setId("100"); sor.setRequestSlotList(rsl); RegistryResponseType prdsrt = new RegistryResponseType(); prdsrt.setResponseSlotList(rsl); prdsrt.setRequestId("1235"); sor.setRegistryObjectList(rolt); XDRResponseMessageType xmt = new XDRResponseMessageType(); eventA.setMessage(xmt); xmt.setAssertion(assertionType); xmt.setRegistryResponse(prdsrt); assertionType.setHomeCommunity(hct); assertionType.setSSN("170112756"); eventA.setSendingHomeCommunity(hct); String direction = "inbound"; eventA.setDirection(direction); eventA.getMessage().setAssertion(assertionType); RequestType request = new RequestType(); SubjectHelper subjHelp = new SubjectHelper(); SubjectType subject = subjHelp.subjectFactory(hct, assertionType); request.getSubject().add(subject); CheckPolicyRequestType result = xdrTransformHelper.transformXDRResponseToCheckPolicy(eventA); verifycheckPolicy_Request(result); }