@Test
    void verifyUserPasswordChangeFail() throws Throwable {
        val c = new UsernamePasswordCredential("casuser", "password");
        val bean = new PasswordChangeRequest();
        bean.setConfirmedPassword("newPassword".toCharArray());
        var res = passwordChangeService.change(bean);
        assertFalse(res);
        bean.setConfirmedPassword("newPassword".toCharArray());
        bean.setPassword("unknown".toCharArray());
        res = passwordChangeService.change(bean);
        assertFalse(res);

        bean.setPassword(bean.getConfirmedPassword());
        c.setUsername(UUID.randomUUID().toString());
        res = passwordChangeService.change(bean);
        assertFalse(res);
    }
This is {@link JsonResourcePasswordManagementServiceTests}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-pm/src/test/java/org/apereo/cas/pm/impl/JsonResourcePasswordManagementServiceTests.java