use of org.apereo.cas.services.JsonServiceRegistryDao in project cas by apereo.
the class GrouperRegisteredServiceAccessStrategyRegistryTests method checkAccessStrategyJson.
@Test
public void checkAccessStrategyJson() throws Exception {
final Map<String, Set<String>> attributes = new HashMap<>();
final Set<String> v1 = new HashSet<>();
v1.add("admin");
attributes.put("memberOf", v1);
final AbstractRegisteredService service = RegisteredServiceTestUtils.getRegisteredService("test");
final GrouperRegisteredServiceAccessStrategy grouper = new GrouperRegisteredServiceAccessStrategy();
grouper.setRequiredAttributes(attributes);
service.setAccessStrategy(grouper);
final JsonServiceRegistryDao dao = new JsonServiceRegistryDao(RESOURCE, false, mock(ApplicationEventPublisher.class));
dao.save(service);
dao.load();
}
use of org.apereo.cas.services.JsonServiceRegistryDao in project cas by apereo.
the class SamlRegisteredServiceTests method verifySavingSamlService.
@Test
public void verifySavingSamlService() throws Exception {
final SamlRegisteredService service = new SamlRegisteredService();
service.setName(SAML_SERVICE);
service.setServiceId("http://mmoayyed.unicon.net");
service.setMetadataLocation(METADATA_LOCATION);
final JsonServiceRegistryDao dao = new JsonServiceRegistryDao(RESOURCE, false, mock(ApplicationEventPublisher.class));
dao.save(service);
dao.load();
}
use of org.apereo.cas.services.JsonServiceRegistryDao 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();
}
Aggregations