Search in sources :

Example 6 with ResetPasswordResult

use of edu.stanford.bmir.protege.web.shared.chgpwd.ResetPasswordResult in project webprotege by protegeproject.

the class ResetPasswordActionHandler_TestCase method shouldReturnSuccessIfEmailAddressComparesEqualIgnoreCase.

@Test
public void shouldReturnSuccessIfEmailAddressComparesEqualIgnoreCase() {
    when(userDetailsManager.getUserByUserIdOrEmail(any(String.class))).thenReturn(Optional.of(userId));
    when(userDetailsManager.getUserDetails(userId)).thenReturn(Optional.of(userDetails));
    when(userDetails.getEmailAddress()).thenReturn(Optional.of(EMAIL_ADDRESS));
    ResetPasswordResult result = handler.execute(action, context);
    assertThat(result.getResultCode(), is(ResetPasswordResultCode.SUCCESS));
}
Also used : ResetPasswordResult(edu.stanford.bmir.protege.web.shared.chgpwd.ResetPasswordResult) Test(org.junit.Test)

Aggregations

ResetPasswordResult (edu.stanford.bmir.protege.web.shared.chgpwd.ResetPasswordResult)6 Test (org.junit.Test)5 Salt (edu.stanford.bmir.protege.web.shared.auth.Salt)2 SaltedPasswordDigest (edu.stanford.bmir.protege.web.shared.auth.SaltedPasswordDigest)2 UserId (edu.stanford.bmir.protege.web.shared.user.UserId)2 UserDetails (edu.stanford.bmir.protege.web.shared.user.UserDetails)1 Nonnull (javax.annotation.Nonnull)1