AssertionHelper { public void appendAssertionDataToRequest(RequestType policyRequest, AssertionType assertion) { LOG.debug("begin appending assertion data to xacml request"); if (assertion != null) { appendAuthnStatementAuthnInstant(policyRequest, assertion); appendAuthnStatementSessionIndex(policyRequest, assertion); appendAuthnStatementAthnContextClassRef(policyRequest, assertion); appendAuthnStatementSubjectLocalityAddress(policyRequest, assertion); appendAuthnStatementDNSName(policyRequest, assertion); appendUserPersonName(policyRequest, assertion); appendUserOrganizationName(policyRequest, assertion); appendUserOrganizationId(policyRequest, assertion); appendHomeCommunityName(policyRequest, assertion); appendUniquePatientId(policyRequest, assertion); appendUserRoleCode(policyRequest, assertion); appendUserRoleCodeSystem(policyRequest, assertion); appendUserRoleCodeSystemName(policyRequest, assertion); appendUserRoleCodeDiplayName(policyRequest, assertion); appendPurposeOfUseCode(policyRequest, assertion); appendPurposeOfUseCodeSystem(policyRequest, assertion); appendPurposeOfUseCodeSystemName(policyRequest, assertion); appendPurposeOfUseCodeDisplayName(policyRequest, assertion); appendAuthzDecisionStatementDecision(policyRequest, assertion); appendAuthzDecisionStatementResource(policyRequest, assertion); appendAuthzDecisionStatementAction(policyRequest, assertion); appendAuthzDecisionStatementEvidenceAssertionID(policyRequest, assertion); appendAuthzDecisionStatementEvidenceAssertionIssueInstant(policyRequest, assertion); appendAuthzDecisionStatementEvidenceAssertionVersion(policyRequest, assertion); appendAuthzDecisionStatementEvidenceAssertionIssuer(policyRequest, assertion); appendAuthzDecisionStatementEvidenceAssertionConditionsNotBefore(policyRequest, assertion); appendAuthzDecisionStatementEvidenceAssertionConditionsNotOnOrAfter(policyRequest, assertion); appendAuthzDecisionStatementEvidenceAssertionAccessConsentPolicy(policyRequest, assertion); appendAuthzDecisionStatementEvidenceAssertionInstanceAccessConsentPolicy(policyRequest, assertion); appendAttributeAccessConsent(policyRequest, assertion); } else { LOG.warn("assertion was not set - unable to extract assertion related data to send to policy engine"); } LOG.debug("end appending assertion data to xacml request"); }  void appendAssertionDataToRequest(RequestType policyRequest, AssertionType assertion); String extractUserName(AssertionType assertion); String extractUserHomeCommunity(AssertionType assertion); String extractPurpose(AssertionType assertion); String extractUserRole(AssertionType assertion);  }
@Test public void testAppendAssertionDataToRequest() { RequestType policyRequest = new RequestType(); AssertionHelper assertHelp = new AssertionHelper(); assertHelp.appendAssertionDataToRequest(policyRequest, defaultAssertion); verifyPolicySubject(policyRequest); verifyPolicyResource(policyRequest); }
@Test public void testNullAssertionDataToRequest() { RequestType policyRequest = new RequestType(); AssertionHelper assertHelp = new AssertionHelper(); assertHelp.appendAssertionDataToRequest(policyRequest, null); }