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

            val query = PasswordManagementQuery.builder().username(UUID.randomUUID().toString()).build();
            val token = passwordManagementService.createToken(query);
            context.getFlowScope().put(PasswordManagementService.PARAMETER_TOKEN, token);

            val resultBuilder = new DefaultAuthenticationResultBuilder(principalElectionStrategy)
                .collect(RegisteredServiceTestUtils.getAuthentication(query.getUsername(),
                    Map.of(casProperties.getAuthn().getMfa().getCore().getAuthenticationContextAttribute(),
                        List.of(multifactorAuthenticationProvider.getId()))));

            WebUtils.putAuthenticationResultBuilder(resultBuilder, context);
            val event = initPasswordResetAction.execute(context);
            assertEquals(CasWebflowConstants.TRANSITION_ID_SUCCESS, event.getId());
            val credential = WebUtils.getCredential(context, UsernamePasswordCredential.class);
            assertNotNull(credential);
            assertEquals(query.getUsername(), credential.getUsername());
        }
This is {@link InitPasswordResetActionTests}.

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