    void checkVerificationCode() throws Exception
    {
        when(this.userManager.exists(this.userReference)).thenReturn(true);
        InternetAddress email = new InternetAddress("foobar@xwiki.org");
        when(this.userProperties.getEmail()).thenReturn(email);
        String verificationCode = "abcd1245";
        BaseObject xObject = mock(BaseObject.class);
        when(this.userDocument
            .getXObject(DefaultResetPasswordManager.RESET_PASSWORD_REQUEST_CLASS_REFERENCE))
            .thenReturn(xObject);
        String encodedVerificationCode = "encodedVerificationCode";
        when(xObject.getStringValue(DefaultResetPasswordManager.VERIFICATION_PROPERTY))
            .thenReturn(encodedVerificationCode);
        BaseClass baseClass = mock(BaseClass.class);
        when(xObject.getXClass(context)).thenReturn(baseClass);
        PasswordClass passwordClass = mock(PasswordClass.class);
        when(baseClass.get(DefaultResetPasswordManager.VERIFICATION_PROPERTY)).thenReturn(passwordClass);
        when(passwordClass.getEquivalentPassword(encodedVerificationCode, verificationCode))
            .thenReturn(encodedVerificationCode);
        String newVerificationCode = "foobartest";
        when(xWiki.generateRandomString(30)).thenReturn(newVerificationCode);
        String saveComment = "Save new verification code";
        when(this.localizationManager
            .getTranslationPlain("xe.admin.passwordReset.step2.versionComment.changeValidationKey"))
            .thenReturn(saveComment);
        DefaultResetPasswordRequestResponse expected =
            new DefaultResetPasswordRequestResponse(this.userReference, email,
                newVerificationCode);

        assertEquals(expected, this.resetPasswordManager.checkVerificationCode(this.userReference, verificationCode));
        verify(this.xWiki).saveDocument(this.userDocument, saveComment, true, context);
    }
The software contains a mechanism for users to recover or change their passwords without knowing the original password, but the mechanism is weak.