AssertionHelper { private ResourceType getResource(RequestType policyRequest) { if (policyRequest == null) { throw new NullPointerException("policy request is null"); } ResourceType resource; if (policyRequest.getResource() != null && !policyRequest.getResource().isEmpty()) { resource = policyRequest.getResource().get(0); } else { resource = new ResourceType(); policyRequest.getResource().add(resource); } return resource; }  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 AssertionSamlAuthzDecisionStatementResourceFromAssertionToXacml() { AssertionType assertion = createTestAssertion(); String sourceValue = assertion.getSamlAuthzDecisionStatement().getResource(); assertFalse(sourceValue.contentEquals("")); executeAssertionToXacmlSingleFieldTest(assertion, "Resource", "urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource", sourceValue, STRING_DATATYPE); }
@Test public void AssertionSamlAuthzDecisionStatementResourceFromAssertionToXacmlWithBlankValue() { AssertionType assertion = createTestAssertion(); assertion.getSamlAuthzDecisionStatement().setResource(""); String sourceValue = assertion.getSamlAuthzDecisionStatement().getResource(); executeAssertionToXacmlSingleFieldTest(assertion, "Resource", "urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource", sourceValue, STRING_DATATYPE); }
@Test public void AssertionSamlAuthzDecisionStatementResourceFromAssertionToXacmlWithNullValue() { AssertionType assertion = createTestAssertion(); assertion.getSamlAuthzDecisionStatement().setResource(null); String sourceValue = assertion.getSamlAuthzDecisionStatement().getResource(); executeAssertionToXacmlSingleFieldTest(assertion, "Resource", "urn:gov:hhs:fha:nhinc:saml-authz-decision-statement-resource", sourceValue, STRING_DATATYPE); }