From e0d69e8300bcb6703a2adb925cd6635bf2662d95 Mon Sep 17 00:00:00 2001 From: Sohan Kumar Dey <72375959+Sohandey@users.noreply.github.com> Date: Tue, 19 Dec 2023 11:59:38 +0530 Subject: [PATCH] MOSIP-30444 Signed-off-by: Sohan Kumar Dey <72375959+Sohandey@users.noreply.github.com> --- .../fw/util/OutputValidationUtil.java | 6 ++--- .../main/resources/ida/DemoAuth/DemoAuth.yml | 10 ++++---- .../main/resources/ida/EkycDemo/EkycDemo.yml | 4 ++-- .../RequestCredentials/ReqCredential.yml | 24 ++++++++++++------- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/automationtests/src/main/java/io/mosip/testrig/apirig/authentication/fw/util/OutputValidationUtil.java b/automationtests/src/main/java/io/mosip/testrig/apirig/authentication/fw/util/OutputValidationUtil.java index ed3e3202447..66b51497ca1 100644 --- a/automationtests/src/main/java/io/mosip/testrig/apirig/authentication/fw/util/OutputValidationUtil.java +++ b/automationtests/src/main/java/io/mosip/testrig/apirig/authentication/fw/util/OutputValidationUtil.java @@ -476,14 +476,14 @@ public static Map> doJsonOutputValidation(Stri public static Map> doJsonOutputValidation(String actualOutputJson, String expOutputJson, boolean checkErrorsOnlyInResponse, String context, boolean responseHasErrors, String allowedErrorCode, int responseStatusCode) throws AdminTestException { - if (doesResponseHasErrorCode(actualOutputJson, 500)) + if (doesResponseHasErrorCode(actualOutputJson, allowedErrorCode)) + return Collections.emptyMap(); + else if (doesResponseHasErrorCode(actualOutputJson, 500)) throw new AdminTestException("Internal Server Error. Hence marking the test case as failed"); else if (doesResponseHasErrorCode(actualOutputJson, 404)) throw new SkipException("API end point is not valid. Hence marking the test case as skipped"); // else if (!(responseStatusCode >= 200 && responseStatusCode < 300)) // throw new SkipException("API endpoint is not valid. Response code: " + responseStatusCode + " Hence marking the test case as skipped"); - else if (doesResponseHasErrorCode(actualOutputJson, allowedErrorCode)) - return Collections.emptyMap(); JsonPrecondtion jsonPrecondtion = new JsonPrecondtion(); Map actual = jsonPrecondtion .retrieveMappingAndItsValueToPerformJsonOutputValidation(actualOutputJson); diff --git a/automationtests/src/main/resources/ida/DemoAuth/DemoAuth.yml b/automationtests/src/main/resources/ida/DemoAuth/DemoAuth.yml index 25e3ca71ab2..167ec08a2fe 100644 --- a/automationtests/src/main/resources/ida/DemoAuth/DemoAuth.yml +++ b/automationtests/src/main/resources/ida/DemoAuth/DemoAuth.yml @@ -590,7 +590,7 @@ DemoAuthNew: "name": [ { "language": "$PRIMARYLANG$", - "value": "TEST_FIRSTNAMEeng" + "value": "TEST_FULLNAMEeng" } ], "timestamp": "$TIMESTAMP$", @@ -742,7 +742,7 @@ DemoAuthNew: "name": [ { "language": "$PRIMARYLANG$", - "value": "TEST_FIRSTNAMEeng" + "value": "TEST_FULLNAMEeng" } ], "timestamp": "$TIMESTAMP$", @@ -1176,7 +1176,7 @@ DemoAuthNew: "name": [ { "language": "$PRIMARYLANG$", - "value": "TEST_FIRSTNAMEeng" + "value": "TEST_FULLNAMEeng" } ], "timestamp": "$TIMESTAMP$", @@ -1189,6 +1189,7 @@ DemoAuthNew: endPoint: /v1/identity/authenticate?moduleName=$MODULENAME$&certsDir=$abagc123&transactionId=$TRANSACTIONID$&id=$ID:AddIdentity_withValidParameters_smoke_Pos_UIN$&partnerUrlSuffix=$PartnerKeyURL$&keyFileNameByPartnerName=true&partnerName=$PartnerName$ role: resident restMethod: post + allowedErrorCodes: Internal Server Error inputTemplate: ida/DemoAuth/DemoAuth outputTemplate: ida/DemoAuth/error input: '{ @@ -1200,10 +1201,11 @@ DemoAuthNew: output: '{ "authStatus": "false" }' - auth_DemoAuth_DOB_Valid_Smoke_with_invalid_certs_and_inavlid_vid: + auth_DemoAuth_DOB_with_invalid_certs_and_invalid_vid: endPoint: /v1/identity/authenticate?moduleName=$MODULENAME$&certsDir=$abagc123&transactionId=$TRANSACTIONID$&id=$ID:GenerateVID_All_Valid_Smoke_Perpetual_sid_vid$&idType=VID&partnerUrlSuffix=$PartnerKeyURL$&keyFileNameByPartnerName=true&partnerName=$PartnerName$ role: resident restMethod: post + allowedErrorCodes: Internal Server Error inputTemplate: ida/DemoAuth/DemoAuth outputTemplate: ida/DemoAuth/error input: '{ diff --git a/automationtests/src/main/resources/ida/EkycDemo/EkycDemo.yml b/automationtests/src/main/resources/ida/EkycDemo/EkycDemo.yml index ee359902feb..f10c60bf9e6 100644 --- a/automationtests/src/main/resources/ida/EkycDemo/EkycDemo.yml +++ b/automationtests/src/main/resources/ida/EkycDemo/EkycDemo.yml @@ -411,7 +411,7 @@ EkycDemo: "name": [ { "language": "$PRIMARYLANG$", - "value": "TEST_FIRSTNAMEeng" + "value": "TEST_FULLNAMEeng" } ], "timestamp": "$TIMESTAMP$", @@ -839,7 +839,7 @@ EkycDemo: input: '{ "timestamp": "$TIMESTAMP$", "transactionId": "$TRANSACTIONID$", - "value": "1980/08/10", + "value": "1970/07/08", "key": "dob" }' output: '{ diff --git a/automationtests/src/main/resources/resident/CredentialIssuance/RequestCredentials/ReqCredential.yml b/automationtests/src/main/resources/resident/CredentialIssuance/RequestCredentials/ReqCredential.yml index a6c18aadbcb..286974ea992 100644 --- a/automationtests/src/main/resources/resident/CredentialIssuance/RequestCredentials/ReqCredential.yml +++ b/automationtests/src/main/resources/resident/CredentialIssuance/RequestCredentials/ReqCredential.yml @@ -1581,10 +1581,14 @@ RequestCredentials: } ], "sendOtpResp":{ - "maskedMobile": "XXXXXX3210", - "sendOtpResTemplate":"resident/SendOTP/createSendOTPResult", - "maskedEmail": "$IGNORE$" - } + "errors": [ + { + "errorCode": "IDA-MLC-018", + "errorMessage": "$IGNORE$" + } + ], + "sendOtpResTemplate":"resident/error" + } }' @@ -1619,10 +1623,14 @@ RequestCredentials: } ], "sendOtpResp":{ - "maskedMobile": "XXXXXX3210", - "sendOtpResTemplate":"resident/SendOTP/createSendOTPResult", - "maskedEmail": "$IGNORE$" - } + "errors": [ + { + "errorCode": "RES-SER-425", + "errorMessage": "$IGNORE$" + } + ], + "sendOtpResTemplate":"resident/error" + } }' Resident_RequestCredentials_euin_VID_Use_One_sid: