// call the SAML token provider and check the generated token.
this.provider.issueToken(context);
assertNotNull("Unexpected null security token", context.getSecurityToken());
SecurityToken securityToken = context.getSecurityToken();
AssertionType assertion = assertionParser.fromElement((Element) securityToken.getTokenValue());
/*
* JAXBContext jaxbContext = JAXBContext.newInstance("org.picketlink.identity.federation.saml.v2.assertion");
* Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); JAXBElement<?> parsedElement = (JAXBElement<?>)
* unmarshaller.unmarshal((Element) context.getSecurityToken() .getTokenValue());
* assertNotNull("Unexpected null element", parsedElement); assertEquals("Unexpected element type", AssertionType.class,
* parsedElement.getDeclaredType());
*
* AssertionType assertion = (AssertionType) parsedElement.getValue(); StandardSecurityToken securityToken =
* (StandardSecurityToken) context.getSecurityToken();
*/
assertEquals("Unexpected token id", securityToken.getTokenID(), assertion.getID());
assertEquals("Unexpected token issuer", "PicketLinkSTS", assertion.getIssuer().getValue());
// check the contents of the assertion conditions.
ConditionsType conditions = assertion.getConditions();
assertNotNull("Unexpected null conditions", conditions);