ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());
SOAPMessage soapMessage = SOAPUtil.getSOAPMessage(bis);
Node xacmlNode = soapMessage.getSOAPBody().getChildNodes().item(0);
XACMLAuthzDecisionStatementType xacmlStatement = SOAPSAMLXACMLUtil.getDecisionStatement(xacmlNode);
/*
* Unmarshaller un = JAXBUtil.getUnmarshaller(SOAPSAMLXACMLUtil.getPackage()); JAXBElement<Envelope> jax =
* (JAXBElement<Envelope>) un.unmarshal(bis); Envelope envelope = jax.getValue(); assertNotNull("Envelope is not null",
* envelope);
*
* JAXBElement<ResponseType> jaxbResponseType = (JAXBElement<ResponseType>) envelope.getBody().getAny().get(0);
* ResponseType responseType = jaxbResponseType.getValue();
*
* assertNotNull("ResponseType is not null", responseType); AssertionType assertion = (AssertionType)
* responseType.getAssertionOrEncryptedAssertion().get(0); XACMLAuthzDecisionStatementType xacmlStatement =
* (XACMLAuthzDecisionStatementType) assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().get(0);
*/
assertNotNull("XACML Authorization Statement is not null", xacmlStatement);
org.jboss.security.xacml.core.model.context.ResponseType xacmlResponse = xacmlStatement.getResponse();
ResultType resultType = xacmlResponse.getResult().get(0);
DecisionType decision = resultType.getDecision();
assertNotNull("Decision is not null", decision);
assertEquals(value, decision.value());
}