@Test
    void verifyPasswordRejected() throws Throwable {
        val context = MockRequestContext.create(applicationContext);

        val credential = RegisteredServiceTestUtils.getCredentialsWithDifferentUsernameAndPassword("error-credential", "P@ssword");
        WebUtils.putCredential(context, credential);

        val changeReq = new PasswordChangeRequest();
        changeReq.setUsername("error-credential");
        changeReq.setPassword("P@ssword".toCharArray());
        changeReq.setConfirmedPassword("P@ssword".toCharArray());
        context.getFlowScope().put(PasswordManagementWebflowConfigurer.FLOW_VAR_ID_PASSWORD, changeReq);
        PasswordManagementWebflowUtils.putPasswordResetUsername(context, changeReq.getUsername());
        assertEquals(CasWebflowConstants.TRANSITION_ID_ERROR, passwordChangeAction.execute(context).getId());
    }
This is {@link PasswordChangeActionTests}.

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