@Test
    void verifyRestore() throws Throwable {
        val client = new FormClient();
        val context = MockRequestContext.create(applicationContext);
        val account = PasswordlessUserAccount.builder().username("casuser").build();
        val sessionTicket = mock(TransientSessionTicket.class);
        val service = RegisteredServiceTestUtils.getService();
        val passwordlessRequest = PasswordlessAuthenticationRequest.builder().username("casuser").build();

        when(sessionTicket.getService()).thenReturn(service);
        when(sessionTicket.getProperty(ArgumentMatchers.eq(PasswordlessUserAccount.class.getName()), any())).thenReturn(account);
        when(sessionTicket.getProperty(ArgumentMatchers.eq(PasswordlessAuthenticationRequest.class.getName()), any())).thenReturn(passwordlessRequest);

        val webContext = new JEEContext(context.getHttpServletRequest(), context.getHttpServletResponse());
        val stored = contributor.restore(context, webContext, Optional.of(sessionTicket), client);
        assertEquals(stored, service);
        assertNotNull(PasswordlessWebflowUtils.getPasswordlessAuthenticationAccount(context, PasswordlessUserAccount.class));
    }
This is {@link PasswordlessDelegatedClientAuthenticationWebflowStateContributorTests}.

@author Misagh Moayyed
@since 6.6.0
support/cas-server-support-passwordless-webflow/src/test/java/org/apereo/cas/web/flow/delegation/PasswordlessDelegatedClientAuthenticationWebflowStateContributorTests.java