@Test
    void verifyOperation() {
        val registeredService = new CasRegisteredService();
        registeredService.setName("CAS");
        registeredService.setTemplateName("ExampleTemplate");
        registeredService.setId(1000);
        registeredService.setDescription("CAS service definition for example application");
        registeredService.setServiceId("https://app.example.org");
        registeredService.setUsernameAttributeProvider(new PrincipalAttributeRegisteredServiceUsernameProvider("uid"));

        val manager = getTemplatesManagerInstanceFrom(casProperties);
        val result = manager.apply(registeredService);

        assertEquals(result.getName(), registeredService.getName());
        assertEquals(result.getId(), registeredService.getId());
        assertEquals(result.getDescription(), registeredService.getDescription());
        assertEquals(result.getServiceId(), registeredService.getServiceId());
        assertEquals(result.getUsernameAttributeProvider(), registeredService.getUsernameAttributeProvider());

        val releasePolicy = (ReturnAllowedAttributeReleasePolicy) result.getAttributeReleasePolicy();
        assertEquals(List.of("email", "username"), releasePolicy.getAllowedAttributes());
        assertEquals(Set.of("email", "username"), releasePolicy.getConsentPolicy().getIncludeOnlyAttributes());
    }
This is {@link DefaultRegisteredServicesTemplatesManagerTests}.

@author Misagh Moayyed
@since 7.0.0
core/cas-server-core-services/src/test/java/org/apereo/cas/services/DefaultRegisteredServicesTemplatesManagerTests.java