use of org.wso2.carbon.identity.user.endpoint.dto.ResendCodeRequestDTO in project identity-governance by wso2-extensions.
the class MeApiServiceImpl method doResendConfirmationCode.
private NotificationResponseBean doResendConfirmationCode(String recoveryScenario, NotificationResponseBean notificationResponseBean, ResendCodeRequestDTO resendCodeRequestDTO) {
UserRecoveryData userRecoveryData = null;
// Currently this me/resend-code API supports resend code during mobile verification scenario only.
if (RecoveryScenarios.MOBILE_VERIFICATION_ON_UPDATE.toString().equals(recoveryScenario)) {
userRecoveryData = Utils.getUserRecoveryData(resendCodeRequestDTO, recoveryScenario);
}
if (userRecoveryData == null) {
return notificationResponseBean;
}
ResendConfirmationManager resendConfirmationManager = Utils.getResendConfirmationManager();
if (RecoveryScenarios.MOBILE_VERIFICATION_ON_UPDATE.toString().equals(recoveryScenario) && RecoveryScenarios.MOBILE_VERIFICATION_ON_UPDATE.equals(userRecoveryData.getRecoveryScenario()) && RecoverySteps.VERIFY_MOBILE_NUMBER.equals(userRecoveryData.getRecoveryStep())) {
notificationResponseBean = setNotificationResponseBean(resendConfirmationManager, RecoveryScenarios.MOBILE_VERIFICATION_ON_UPDATE.toString(), RecoverySteps.VERIFY_MOBILE_NUMBER.toString(), IdentityRecoveryConstants.NOTIFICATION_TYPE_VERIFY_MOBILE_ON_UPDATE, resendCodeRequestDTO);
}
return notificationResponseBean;
}
use of org.wso2.carbon.identity.user.endpoint.dto.ResendCodeRequestDTO in project identity-governance by wso2-extensions.
the class ResendCodeApiServiceImplTest method duplicateScenarioResendCodeRequestDTO.
private ResendCodeRequestDTO duplicateScenarioResendCodeRequestDTO() {
ResendCodeRequestDTO resendCodeRequestDTO = new ResendCodeRequestDTO();
resendCodeRequestDTO.setUser(buildUserDTO());
List<PropertyDTO> listProperty = new ArrayList<>();
listProperty.add(recoveryScenarioPropertyDTO());
listProperty.add(recoveryScenarioPropertyDTO());
resendCodeRequestDTO.setProperties(listProperty);
return resendCodeRequestDTO;
}
use of org.wso2.carbon.identity.user.endpoint.dto.ResendCodeRequestDTO in project identity-governance by wso2-extensions.
the class ResendCodeApiServiceImplTest method testIdentityRecoveryExceptioninResendCodePost.
@Test
public void testIdentityRecoveryExceptioninResendCodePost() throws IdentityRecoveryException {
Mockito.when(userSelfRegistrationManager.resendConfirmationCode(Utils.getUser(resendCodeRequestDTO().getUser()), Utils.getProperties(resendCodeRequestDTO().getProperties()))).thenThrow(new IdentityRecoveryException("Recovery Exception"));
assertEquals(resendCodeApiService.resendCodePost(resendCodeRequestDTO()).getStatus(), 501);
}
use of org.wso2.carbon.identity.user.endpoint.dto.ResendCodeRequestDTO in project identity-governance by wso2-extensions.
the class ResendCodeApiServiceImplTest method recoveryScenarioResendCodeRequestDTO.
private ResendCodeRequestDTO recoveryScenarioResendCodeRequestDTO() {
ResendCodeRequestDTO resendCodeRequestDTO = new ResendCodeRequestDTO();
resendCodeRequestDTO.setUser(buildUserDTO());
List<PropertyDTO> listProperty = new ArrayList<>();
listProperty.add(recoveryScenarioPropertyDTO());
resendCodeRequestDTO.setProperties(listProperty);
return resendCodeRequestDTO;
}
use of org.wso2.carbon.identity.user.endpoint.dto.ResendCodeRequestDTO in project identity-governance by wso2-extensions.
the class ResendCodeApiServiceImplTest method resendCodeRequestDTO.
private ResendCodeRequestDTO resendCodeRequestDTO() {
ResendCodeRequestDTO resendCodeRequestDTO = new ResendCodeRequestDTO();
resendCodeRequestDTO.setUser(buildUserDTO());
List<PropertyDTO> listProperty = new ArrayList<>();
listProperty.add(buildPropertyDTO());
resendCodeRequestDTO.setProperties(listProperty);
return resendCodeRequestDTO;
}
Aggregations