@Test
    void verifyOperation() throws Throwable {
        MockRequestContext.create(applicationContext);

        val plan = mock(CasWebflowExecutionPlan.class);
        when(plan.getWebflowLoginContextProviders()).thenReturn(List.of());

        val director = new CasThymeleafTemplatesDirector(plan);
        assertNotNull(director.getExceptionClassSimpleName(new AuthenticationException()));
        assertEquals(LOGIN_URL + '?', director.getUrlExternalForm(new URI(LOGIN_URL).toURL()));
        assertEquals(LOGIN_URL_WITH_CLIENT_NAME + '&', director.getUrlExternalForm(new URI(LOGIN_URL_WITH_CLIENT_NAME).toURL()));
        assertTrue(director.isLoginFormViewable(mock(WebEngineContext.class)));
        assertTrue(director.isLoginFormUsernameInputVisible(mock(WebEngineContext.class)));
        assertFalse(director.isLoginFormUsernameInputDisabled(mock(WebEngineContext.class)));

        assertTrue(director.getLoginFormUsername(mock(WebEngineContext.class)).isEmpty());

        val provider = mock(CasWebflowLoginContextProvider.class);
        when(provider.getOrder()).thenCallRealMethod();
        when(provider.getCandidateUsername(any())).thenReturn(Optional.of("cas"));
        when(plan.getWebflowLoginContextProviders()).thenReturn(List.of(provider));
        assertFalse(director.getLoginFormUsername(mock(WebEngineContext.class)).isEmpty());

        assertNotNull(director.format(LocalDateTime.now(Clock.systemUTC()), "yyyy/mm/dd"));
    }
This is {@link CasThymeleafTemplatesDirectorTests}.

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