use of org.wso2.carbon.identity.recovery.password.SecurityQuestionPasswordRecoveryManager in project identity-governance by wso2-extensions.
the class ValidateAnswerApiServiceImplTest method testIdentityRecoveryClientExceptionwithCodeforValidateAnswerPost.
@Test
public void testIdentityRecoveryClientExceptionwithCodeforValidateAnswerPost() throws IdentityRecoveryException {
mockedRecoveryUtil.when(RecoveryUtil::getSecurityQuestionBasedPwdRecoveryManager).thenReturn(securityQuestionPasswordRecoveryManager);
Mockito.when(securityQuestionPasswordRecoveryManager.validateUserChallengeQuestions(isNull(), anyString(), isNull())).thenThrow(new IdentityRecoveryClientException(IdentityRecoveryConstants.ErrorMessages.ERROR_CODE_INVALID_ANSWER_FOR_SECURITY_QUESTION.getCode(), ""));
assertEquals(validateAnswerApiService.validateAnswerPost(buildAnswerVerificationRequestDTO()).getStatus(), 412);
}
Aggregations