* Test that creates, sends and processes an unsigned SAML 2 authentication assertion
* with two AudienceRestriction Elements
*/
@org.junit.Test
public void testSAML2AudienceRestrictionSeparateRestrictions() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
callbackHandler.setIssuer("www.example.com");
ConditionsBean conditions = new ConditionsBean();
conditions.setTokenPeriodMinutes(5);
List<AudienceRestrictionBean> audiencesRestrictions =
new ArrayList<AudienceRestrictionBean>();
AudienceRestrictionBean audienceRestrictionBean = new AudienceRestrictionBean();
audienceRestrictionBean.setAudienceURIs(Collections.singletonList("http://apache.org/one"));
audiencesRestrictions.add(audienceRestrictionBean);
audienceRestrictionBean = new AudienceRestrictionBean();
audienceRestrictionBean.setAudienceURIs(Collections.singletonList("http://apache.org/two"));
audiencesRestrictions.add(audienceRestrictionBean);
conditions.setAudienceRestrictions(audiencesRestrictions);
callbackHandler.setConditions(conditions);
SAMLParms samlParms = new SAMLParms();
samlParms.setCallbackHandler(callbackHandler);
AssertionWrapper assertion = new AssertionWrapper(samlParms);