Skip to content

Commit

Permalink
MOSIP-30444
Browse files Browse the repository at this point in the history
Signed-off-by: Sohan Kumar Dey <[email protected]>
  • Loading branch information
Sohandey committed Dec 19, 2023
1 parent 08b239f commit e0d69e8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -476,14 +476,14 @@ public static Map<String, List<OutputValidationDto>> doJsonOutputValidation(Stri
public static Map<String, List<OutputValidationDto>> 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<String, String> actual = jsonPrecondtion
.retrieveMappingAndItsValueToPerformJsonOutputValidation(actualOutputJson);
Expand Down
10 changes: 6 additions & 4 deletions automationtests/src/main/resources/ida/DemoAuth/DemoAuth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ DemoAuthNew:
"name": [
{
"language": "$PRIMARYLANG$",
"value": "TEST_FIRSTNAMEeng"
"value": "TEST_FULLNAMEeng"
}
],
"timestamp": "$TIMESTAMP$",
Expand Down Expand Up @@ -742,7 +742,7 @@ DemoAuthNew:
"name": [
{
"language": "$PRIMARYLANG$",
"value": "TEST_FIRSTNAMEeng"
"value": "TEST_FULLNAMEeng"
}
],
"timestamp": "$TIMESTAMP$",
Expand Down Expand Up @@ -1176,7 +1176,7 @@ DemoAuthNew:
"name": [
{
"language": "$PRIMARYLANG$",
"value": "TEST_FIRSTNAMEeng"
"value": "TEST_FULLNAMEeng"
}
],
"timestamp": "$TIMESTAMP$",
Expand All @@ -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: '{
Expand All @@ -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: '{
Expand Down
4 changes: 2 additions & 2 deletions automationtests/src/main/resources/ida/EkycDemo/EkycDemo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ EkycDemo:
"name": [
{
"language": "$PRIMARYLANG$",
"value": "TEST_FIRSTNAMEeng"
"value": "TEST_FULLNAMEeng"
}
],
"timestamp": "$TIMESTAMP$",
Expand Down Expand Up @@ -839,7 +839,7 @@ EkycDemo:
input: '{
"timestamp": "$TIMESTAMP$",
"transactionId": "$TRANSACTIONID$",
"value": "1980/08/10",
"value": "1970/07/08",
"key": "dob"
}'
output: '{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1581,10 +1581,14 @@ RequestCredentials:
}
],
"sendOtpResp":{
"maskedMobile": "XXXXXX3210",
"sendOtpResTemplate":"resident/SendOTP/createSendOTPResult",
"maskedEmail": "$IGNORE$"
}
"errors": [
{
"errorCode": "IDA-MLC-018",
"errorMessage": "$IGNORE$"
}
],
"sendOtpResTemplate":"resident/error"
}
}'


Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e0d69e8

Please sign in to comment.