@Test
    void verifyUpdatingServices() {
        getRegisteredServiceTypes().forEach(type -> {
            val toSave = buildRegisteredServiceInstance(200, type).setId(RegisteredServiceDefinition.INITIAL_IDENTIFIER_VALUE);
            serviceRegistry.save(toSave);
            val services = serviceRegistry.load();
            assertFalse(services.isEmpty());
            val rs = (BaseRegisteredService) serviceRegistry.findServiceById(services.iterator().next().getId());
            assertNotNull(rs, type::getName);
            rs.setEvaluationOrder(9999);
            rs.setUsernameAttributeProvider(new DefaultRegisteredServiceUsernameProvider());
            rs.setDescription("The new description");
            rs.setServiceId("https://hello.world");
            rs.setTheme("some-theme");

            if (rs instanceof final CasRegisteredService cas) {
                val policy = new RegexMatchingRegisteredServiceProxyPolicy();
                policy.setPattern("https");
                cas.setProxyPolicy(policy);
            }
            rs.setAttributeReleasePolicy(new ReturnAllowedAttributeReleasePolicy());
            assertNotNull(serviceRegistry.save(rs), type::getName);

            val rs3 = (WebBasedRegisteredService) serviceRegistry.findServiceById(rs.getId());
            assertEquals(rs3.getDescription(), rs.getDescription());
            assertEquals(rs3.getEvaluationOrder(), rs.getEvaluationOrder());
            assertEquals(rs3.getUsernameAttributeProvider(), rs.getUsernameAttributeProvider());
            assertEquals(rs3.getServiceId(), rs.getServiceId());
            assertEquals(rs3.getTheme(), rs.getTheme());

            val rs4 = serviceRegistry.findServicePredicate(registeredService -> registeredService.getId() == rs.getId());
            assertTrue(rs4.stream().map(rs5 -> rs5.getName().equals(rs.getName())).findFirst().isPresent());
        });
    }
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