@Test
    void verifyGroovyTemplates() {
        val registeredService = new CasRegisteredService();
        registeredService.setName("CAS");
        registeredService.setTemplateName("GroovyTemplate");
        registeredService.setId(1000);
        registeredService.getProperties().put("GivenDescription",
            new DefaultRegisteredServiceProperty("This is my description"));
        registeredService.getProperties().put("GivenUsernameAttribute",
            new DefaultRegisteredServiceProperty("email"));
        registeredService.getProperties().put("AllowedAttributes",
            new DefaultRegisteredServiceProperty("email", "username"));

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

        assertEquals(result.getName(), registeredService.getName());
        assertEquals(result.getId(), registeredService.getId());
        val uidProvider = (PrincipalAttributeRegisteredServiceUsernameProvider) result.getUsernameAttributeProvider();
        assertEquals("email", uidProvider.getUsernameAttribute());

        val releasePolicy = (ReturnAllowedAttributeReleasePolicy) result.getAttributeReleasePolicy();
        assertEquals(List.of("email", "username"), releasePolicy.getAllowedAttributes());
    }
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