public void testSAML2ProxyRestriction() throws Exception {
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
callbackHandler.setIssuer("www.example.com");
ConditionsBean conditions = new ConditionsBean();
conditions.setTokenPeriodMinutes(5);
ProxyRestrictionBean proxyRestriction = new ProxyRestrictionBean();
List<String> audiences = new ArrayList<String>();
audiences.add("http://apache.org/one");
audiences.add("http://apache.org/two");
proxyRestriction.getAudienceURIs().addAll(audiences);
proxyRestriction.setCount(5);
conditions.setProxyRestriction(proxyRestriction);
callbackHandler.setConditions(conditions);
SAMLCallback samlCallback = new SAMLCallback();
SAMLUtil.doSAMLCallback(callbackHandler, samlCallback);