@Test
    void execSaveMethodWithConsentPolicy() {
        getRegisteredServiceTypes().forEach(type -> {
            val r = buildRegisteredServiceInstance(RandomUtils.nextInt(), type)
                .setId(RegisteredServiceDefinition.INITIAL_IDENTIFIER_VALUE);
            val policy = new ReturnAllAttributeReleasePolicy();
            policy.setConsentPolicy(new DefaultRegisteredServiceConsentPolicy(CollectionUtils.wrapSet("test"),
                CollectionUtils.wrapSet("test")));
            r.setAttributeReleasePolicy(policy);
            val r2 = serviceRegistry.save(r);
            val r3 = serviceRegistry.findServiceById(r2.getId());
            assertEquals(r2, r3);
        });
    }
Abstracted service registry tests for all implementations.

@author Timur Duehr
@since 5.3.0
core/cas-server-core-services/src/test/java/org/apereo/cas/services/AbstractServiceRegistryTests.java