Skip to content

Commit

Permalink
Fix #397: Replace status OTP_VERIFICATION_PENDING by VERIFICATION_PEN…
Browse files Browse the repository at this point in the history
…DING (#398)
  • Loading branch information
banterCZ authored Sep 26, 2022
1 parent 5c2575b commit c513c59
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ public interface IdentityVerificationRepository extends CrudRepository<IdentityV
"WHERE i.activationId = :activationId " +
"AND i.status IN (" +
"com.wultra.app.enrollmentserver.model.enumeration.IdentityVerificationStatus.IN_PROGRESS, " +
"com.wultra.app.enrollmentserver.model.enumeration.IdentityVerificationStatus.VERIFICATION_PENDING, " +
"com.wultra.app.enrollmentserver.model.enumeration.IdentityVerificationStatus.OTP_VERIFICATION_PENDING" +
"com.wultra.app.enrollmentserver.model.enumeration.IdentityVerificationStatus.VERIFICATION_PENDING" +
")")
int failRunningVerifications(String activationId, Date timestamp);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ public enum IdentityVerificationStatus {
*/
VERIFICATION_PENDING,

/**
* OTP code verification is pending.
*/
OTP_VERIFICATION_PENDING,

/**
* All submitted documents have been verified and accepted as valid documents and OTP has been verified.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public void resendOtp(IdentityVerificationEntity identityVerification) throws On
@Transactional
public void sendOtp(IdentityVerificationEntity identityVerification) throws OnboardingProcessException, OnboardingOtpDeliveryException {
identityVerification.setPhase(IdentityVerificationPhase.OTP_VERIFICATION);
identityVerification.setStatus(IdentityVerificationStatus.OTP_VERIFICATION_PENDING);
logger.info("Switched to OTP_VERIFICATION/OTP_VERIFICATION_PENDING; process ID: {}", identityVerification.getProcessId());
identityVerification.setStatus(IdentityVerificationStatus.VERIFICATION_PENDING);
logger.info("Switched to OTP_VERIFICATION/VERIFICATION_PENDING; process ID: {}", identityVerification.getProcessId());
sendOtpCode(identityVerification.getProcessId(), false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public enum OnboardingState {

PRESENCE_CHECK_VERIFICATION_PENDING(IdentityVerificationPhase.PRESENCE_CHECK, IdentityVerificationStatus.VERIFICATION_PENDING),

OTP_VERIFICATION_PENDING(IdentityVerificationPhase.OTP_VERIFICATION, IdentityVerificationStatus.OTP_VERIFICATION_PENDING),
OTP_VERIFICATION_PENDING(IdentityVerificationPhase.OTP_VERIFICATION, IdentityVerificationStatus.VERIFICATION_PENDING),

COMPLETED_ACCEPTED(IdentityVerificationPhase.COMPLETED, IdentityVerificationStatus.ACCEPTED),
COMPLETED_FAILED(IdentityVerificationPhase.COMPLETED, IdentityVerificationStatus.FAILED),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void testDocumentVerificationTransitionToSendingOtp() throws Exception {
when(identityVerificationConfig.isVerificationOtpEnabled()).thenReturn(true);
doAnswer(args -> {
idVerification.setPhase(IdentityVerificationPhase.OTP_VERIFICATION);
idVerification.setStatus(IdentityVerificationStatus.OTP_VERIFICATION_PENDING);
idVerification.setStatus(IdentityVerificationStatus.VERIFICATION_PENDING);
return null;
}).when(identityVerificationOtpService).sendOtp(idVerification);

Expand All @@ -126,7 +126,7 @@ void testDocumentVerificationTransitionToSendingOtp() throws Exception {
.test();

assertEquals(IdentityVerificationPhase.OTP_VERIFICATION, idVerification.getPhase());
assertEquals(IdentityVerificationStatus.OTP_VERIFICATION_PENDING, idVerification.getStatus());
assertEquals(IdentityVerificationStatus.VERIFICATION_PENDING, idVerification.getStatus());
verify(identityVerificationOtpService).sendOtp(idVerification);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void testOtpNotVerified() throws Exception {

private IdentityVerificationEntity createIdentityVerification() {
return super.createIdentityVerification(
IdentityVerificationPhase.OTP_VERIFICATION, IdentityVerificationStatus.OTP_VERIFICATION_PENDING
IdentityVerificationPhase.OTP_VERIFICATION, IdentityVerificationStatus.VERIFICATION_PENDING
);
}

Expand Down

0 comments on commit c513c59

Please sign in to comment.