@Test
        void verifyGroovyTheme() throws Throwable {
            val context = MockRequestContext.create(applicationContext);
            val registeredService = RegisteredServiceTestUtils.getRegisteredService(UUID.randomUUID().toString());

            val file = File.createTempFile("Theme", ".groovy");
            val script = IOUtils.toString(new ClassPathResource("GroovyTheme.groovy").getInputStream(), UTF_8);
            FileUtils.writeStringToFile(file, script, UTF_8);
            registeredService.setTheme(file.getCanonicalPath());
            servicesManager.save(registeredService);
            val service = RegisteredServiceTestUtils.getService(registeredService.getServiceId());
            WebUtils.putServiceIntoFlowScope(context, service);
            assertEquals("some-theme", themeResolver.resolveThemeName(context.getHttpServletRequest()));
        }
This is {@link RegisteredServiceThemeResolverTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-themes/src/test/java/org/apereo/cas/services/web/RegisteredServiceThemeResolverTests.java