Search in sources :

Example 1 with InCommonRSAttributeReleasePolicy

use of org.apereo.cas.support.saml.services.InCommonRSAttributeReleasePolicy in project cas by apereo.

the class SamlRegisteredServiceTests method verifySavingInCommonSamlService.

@Test
public void verifySavingInCommonSamlService() throws Exception {
    final SamlRegisteredService service = new SamlRegisteredService();
    service.setName(SAML_SERVICE);
    service.setServiceId("http://mmoayyed.unicon.net");
    service.setMetadataLocation(METADATA_LOCATION);
    final InCommonRSAttributeReleasePolicy policy = new InCommonRSAttributeReleasePolicy();
    final ChainingAttributeReleasePolicy chain = new ChainingAttributeReleasePolicy();
    chain.setPolicies(Arrays.asList(policy, new DenyAllAttributeReleasePolicy()));
    service.setAttributeReleasePolicy(chain);
    final JsonServiceRegistryDao dao = new JsonServiceRegistryDao(RESOURCE, false, mock(ApplicationEventPublisher.class));
    dao.save(service);
    dao.load();
}
Also used : InCommonRSAttributeReleasePolicy(org.apereo.cas.support.saml.services.InCommonRSAttributeReleasePolicy) DenyAllAttributeReleasePolicy(org.apereo.cas.services.DenyAllAttributeReleasePolicy) JsonServiceRegistryDao(org.apereo.cas.services.JsonServiceRegistryDao) SamlRegisteredService(org.apereo.cas.support.saml.services.SamlRegisteredService) ApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) ChainingAttributeReleasePolicy(org.apereo.cas.services.ChainingAttributeReleasePolicy) Test(org.junit.Test)

Aggregations

ChainingAttributeReleasePolicy (org.apereo.cas.services.ChainingAttributeReleasePolicy)1 DenyAllAttributeReleasePolicy (org.apereo.cas.services.DenyAllAttributeReleasePolicy)1 JsonServiceRegistryDao (org.apereo.cas.services.JsonServiceRegistryDao)1 InCommonRSAttributeReleasePolicy (org.apereo.cas.support.saml.services.InCommonRSAttributeReleasePolicy)1 SamlRegisteredService (org.apereo.cas.support.saml.services.SamlRegisteredService)1 Test (org.junit.Test)1 ApplicationEventPublisher (org.springframework.context.ApplicationEventPublisher)1