@Test
        void verifyActionWithResetRequestInContext() throws Throwable {
            val context = MockRequestContext.create(applicationContext);
            context.setRemoteAddr("1.2.3.4");
            context.setLocalAddr("1.2.3.4");
            context.withUserAgent();
            context.setClientInfo();

            val token = passwordManagementService.createToken(PasswordManagementQuery.builder().username("casuser").build());
            val transientFactory = (TransientSessionTicketFactory) ticketFactory.get(TransientSessionTicket.class);
            val serverPrefix = casProperties.getServer().getPrefix();
            val service = webApplicationServiceFactory.createService(serverPrefix);
            val properties = CollectionUtils.<String, Serializable>wrap(PasswordManagementService.PARAMETER_TOKEN, token);
            val ticket = transientFactory.create(service, properties);
            val addedTicket = ticketRegistry.addTicket(ticket);
            val passwordResetRequest = PasswordResetRequest.builder().passwordResetTicket(addedTicket).username("casuser").build();
            PasswordManagementWebflowUtils.putPasswordResetRequest(context, passwordResetRequest);
            assertEquals(CasWebflowConstants.TRANSITION_ID_SUCCESS, verifyPasswordResetRequestAction.execute(context).getId());

            assertTrue(PasswordManagementWebflowUtils.isPasswordResetSecurityQuestionsEnabled(context));
            assertNotNull(PasswordManagementWebflowUtils.getPasswordResetUsername(context));
            assertNotNull(PasswordManagementWebflowUtils.getPasswordResetToken(context));
            assertThrows(InvalidTicketException.class, () -> ticketRegistry.getTicket(ticket.getId(), TransientSessionTicket.class));
        }
This is {@link VerifyPasswordResetRequestActionTests}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-pm-webflow/src/test/java/org/apereo/cas/pm/web/flow/actions/VerifyPasswordResetRequestActionTests.java