From 456461b3b7e05280f9c91f77568496dceefb92ca Mon Sep 17 00:00:00 2001 From: Aravindhan Alagesan Date: Thu, 2 Nov 2023 17:18:05 +0530 Subject: [PATCH] [MOSIP-23229] Auth type validation case insensitive taken care (#1139) * Added the string lower case function to avoid error throwing while comparing Signed-off-by: Aravindhan Alagesan * Added the string lower case function to avoid error throwing while comparing Signed-off-by: Aravindhan Alagesan * Added the string lower case function to avoid error throwing while comparing Signed-off-by: Aravindhan Alagesan * Added the condition to validate unlockfor second param to avoid confusion incase of authentication locked Signed-off-by: Aravindhan Alagesan * Added the condition to validate unlockfor second param to avoid confusion incase of authentication locked Signed-off-by: Aravindhan Alagesan * Added the condition to validate unlockfor second param to avoid confusion incase of authentication locked Signed-off-by: Aravindhan Alagesan * Added the condition to validate unlockfor second param to avoid confusion incase of authentication locked Signed-off-by: Aravindhan Alagesan * Changes in test cases based on field name changes Signed-off-by: Aravindhan Alagesan * Added the condition to validate unlockfor second param to avoid confusion incase of authentication locked Signed-off-by: Aravindhan Alagesan --------- Signed-off-by: Aravindhan Alagesan --- .../validator/RequestValidatorTest.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/resident/resident-service/src/test/java/io/mosip/resident/validator/RequestValidatorTest.java b/resident/resident-service/src/test/java/io/mosip/resident/validator/RequestValidatorTest.java index 68c4e3d7558..66a6c27c4d6 100644 --- a/resident/resident-service/src/test/java/io/mosip/resident/validator/RequestValidatorTest.java +++ b/resident/resident-service/src/test/java/io/mosip/resident/validator/RequestValidatorTest.java @@ -1410,11 +1410,11 @@ public void testValidateAuthLockRequestV2NegativeUnlockForSeconds() throws Excep requestWrapper.setVersion("1.0"); requestWrapper.setRequest(authLockOrUnLockRequestDtoV2); try { - requestValidator.validateAuthLockOrUnlockRequestV2(requestWrapper); - } catch (BaseResidentUncheckedExceptionWithMetadata e) { - assertEquals(e.getErrorCode(),ResidentErrorCode.UNSUPPORTED_INPUT.getErrorCode()); - return; - } + requestValidator.validateAuthLockOrUnlockRequestV2(requestWrapper); + } catch (BaseResidentUncheckedExceptionWithMetadata e) { + assertEquals(e.getErrorCode(),ResidentErrorCode.UNSUPPORTED_INPUT.getErrorCode()); + return; + } fail(); } @@ -3205,10 +3205,10 @@ public void testValidateAuthLockOrUnlockRequestV2FailedUnlockSeconds() throws Ex requestWrapper.setRequest(authLockOrUnLockRequestDtoV2); try { requestValidator.validateAuthLockOrUnlockRequestV2(requestWrapper); - } catch (BaseResidentUncheckedExceptionWithMetadata e) { - assertEquals(e.getErrorCode(),ResidentErrorCode.UNSUPPORTED_INPUT.getErrorCode()); - return; - } + } catch (BaseResidentUncheckedExceptionWithMetadata e) { + assertEquals(e.getErrorCode(),ResidentErrorCode.UNSUPPORTED_INPUT.getErrorCode()); + return; + } fail(); } -} +} \ No newline at end of file