Skip to content

Commit

Permalink
Fixed test failure
Browse files Browse the repository at this point in the history
Signed-off-by: Loganathan Sekar <[email protected]>
  • Loading branch information
Loganathan Sekar authored and Loganathan Sekar committed Feb 7, 2024
1 parent 40979b7 commit a0bec18
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void before() {
ReflectionTestUtils.setField(otpManager, "otpFrozenTimeMinutes", 30);
templateLanguages.add("eng");
templateLanguages.add("ara");
EnvUtil.setKeySplitter("#KEY_SPLITTER#");
}

private static final String VALIDATION_UNSUCCESSFUL = "VALIDATION_UNSUCCESSFUL";
Expand Down Expand Up @@ -964,7 +965,7 @@ public void TestValidAttemptWith_nullUpdateCount()
Mockito.when(securityManager.hash(Mockito.anyString())).thenReturn("hash");
OtpTransaction otpEntity = new OtpTransaction();
otpEntity.setStatusCode(IdAuthCommonConstants.ACTIVE_STATUS);
otpEntity.setOtpHash("3132333435366E756C6C54657374313233");
otpEntity.setOtpHash("313233343536234B45595F53504C49545445522354657374313233");
otpEntity.setExpiryDtimes(DateUtils.getUTCCurrentDateTime().plus(1, ChronoUnit.MINUTES));

Mockito.when(otpRepo.findFirstByRefIdOrderByGeneratedDtimesDesc(Mockito.anyString())).thenReturn(Optional.of(otpEntity ));
Expand All @@ -990,7 +991,7 @@ public void TestValidAttemptWith_1UpdateCount()
OtpTransaction otpEntity = new OtpTransaction();
otpEntity.setStatusCode(IdAuthCommonConstants.ACTIVE_STATUS);
otpEntity.setValidationRetryCount(1);
otpEntity.setOtpHash("3132333435366E756C6C54657374313233");
otpEntity.setOtpHash("313233343536234B45595F53504C49545445522354657374313233");
otpEntity.setExpiryDtimes(DateUtils.getUTCCurrentDateTime().plus(1, ChronoUnit.MINUTES));

Mockito.when(otpRepo.findFirstByRefIdOrderByGeneratedDtimesDesc(Mockito.anyString())).thenReturn(Optional.of(otpEntity ));
Expand All @@ -1016,7 +1017,7 @@ public void TestValidAttemptWith_4UpdateCount()
OtpTransaction otpEntity = new OtpTransaction();
otpEntity.setStatusCode(IdAuthCommonConstants.ACTIVE_STATUS);
otpEntity.setValidationRetryCount(4);
otpEntity.setOtpHash("3132333435366E756C6C54657374313233");
otpEntity.setOtpHash("313233343536234B45595F53504C49545445522354657374313233");
otpEntity.setExpiryDtimes(DateUtils.getUTCCurrentDateTime().plus(1, ChronoUnit.MINUTES));

Mockito.when(otpRepo.findFirstByRefIdOrderByGeneratedDtimesDesc(Mockito.anyString())).thenReturn(Optional.of(otpEntity ));
Expand All @@ -1042,7 +1043,7 @@ public void TestValidAttemptWith_FrozenStatus()
OtpTransaction otpEntity = new OtpTransaction();
otpEntity.setStatusCode(IdAuthCommonConstants.FROZEN);
otpEntity.setValidationRetryCount(5);
otpEntity.setOtpHash("3132333435366E756C6C54657374313233");
otpEntity.setOtpHash("313233343536234B45595F53504C49545445522354657374313233");
otpEntity.setExpiryDtimes(DateUtils.getUTCCurrentDateTime().plus(1, ChronoUnit.MINUTES));

Mockito.when(otpRepo.findFirstByRefIdOrderByGeneratedDtimesDesc(Mockito.anyString())).thenReturn(Optional.of(otpEntity ));
Expand Down Expand Up @@ -1071,7 +1072,7 @@ public void TestValidAttemptWith_FrozenStatusWithin25Mins()
otpEntity.setStatusCode(IdAuthCommonConstants.FROZEN);
otpEntity.setValidationRetryCount(5);
otpEntity.setUpdDTimes(DateUtils.getUTCCurrentDateTime().minus(25, ChronoUnit.MINUTES));
otpEntity.setOtpHash("3132333435366E756C6C54657374313233");
otpEntity.setOtpHash("313233343536234B45595F53504C49545445522354657374313233");
otpEntity.setExpiryDtimes(DateUtils.getUTCCurrentDateTime().plus(1, ChronoUnit.MINUTES));

Mockito.when(otpRepo.findFirstByRefIdOrderByGeneratedDtimesDesc(Mockito.anyString())).thenReturn(Optional.of(otpEntity ));
Expand Down Expand Up @@ -1100,7 +1101,7 @@ public void TestValidAttemptWith_FrozenStatusWithin29Mins()
otpEntity.setStatusCode(IdAuthCommonConstants.FROZEN);
otpEntity.setValidationRetryCount(5);
otpEntity.setUpdDTimes(DateUtils.getUTCCurrentDateTime().minus(29, ChronoUnit.MINUTES));
otpEntity.setOtpHash("3132333435366E756C6C54657374313233");
otpEntity.setOtpHash("313233343536234B45595F53504C49545445522354657374313233");
otpEntity.setExpiryDtimes(DateUtils.getUTCCurrentDateTime().plus(1, ChronoUnit.MINUTES));

Mockito.when(otpRepo.findFirstByRefIdOrderByGeneratedDtimesDesc(Mockito.anyString())).thenReturn(Optional.of(otpEntity ));
Expand Down Expand Up @@ -1129,7 +1130,7 @@ public void TestValidAttemptWith_FrozenStatusWithin31Mins()
otpEntity.setStatusCode(IdAuthCommonConstants.FROZEN);
otpEntity.setValidationRetryCount(5);
otpEntity.setUpdDTimes(DateUtils.getUTCCurrentDateTime().minus(31, ChronoUnit.MINUTES));
otpEntity.setOtpHash("3132333435366E756C6C54657374313233");
otpEntity.setOtpHash("313233343536234B45595F53504C49545445522354657374313233");
otpEntity.setExpiryDtimes(DateUtils.getUTCCurrentDateTime().plus(1, ChronoUnit.MINUTES));

Mockito.when(otpRepo.findFirstByRefIdOrderByGeneratedDtimesDesc(Mockito.anyString())).thenReturn(Optional.of(otpEntity ));
Expand All @@ -1156,7 +1157,7 @@ public void TestValidAttemptWith_FrozenStatusWithin31Mins_expiredOtp()
otpEntity.setStatusCode(IdAuthCommonConstants.FROZEN);
otpEntity.setValidationRetryCount(5);
otpEntity.setUpdDTimes(DateUtils.getUTCCurrentDateTime().minus(31, ChronoUnit.MINUTES));
otpEntity.setOtpHash("3132333435366E756C6C54657374313233");
otpEntity.setOtpHash("313233343536234B45595F53504C49545445522354657374313233");
otpEntity.setExpiryDtimes(DateUtils.getUTCCurrentDateTime().minus(1, ChronoUnit.MINUTES));

Mockito.when(otpRepo.findFirstByRefIdOrderByGeneratedDtimesDesc(Mockito.anyString())).thenReturn(Optional.of(otpEntity ));
Expand Down

0 comments on commit a0bec18

Please sign in to comment.