@Test
        void verifyUrlTheme() throws Throwable {
            try (val webServer = new MockWebServer("custom-theme")) {
                webServer.start();
                val context = MockRequestContext.create(applicationContext);
                val registeredService = RegisteredServiceTestUtils.getRegisteredService(UUID.randomUUID().toString());
                registeredService.setTheme("http://localhost:%s".formatted(webServer.getPort()));
                servicesManager.save(registeredService);
                val service = RegisteredServiceTestUtils.getService(registeredService.getServiceId());
                WebUtils.putServiceIntoFlowScope(context, service);

                assertDoesNotThrow(() -> themeResolver.setThemeName(context.getHttpServletRequest(),
                    context.getHttpServletResponse(), "whatever"));
                assertEquals("custom-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