Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-33998 automation fix MOSIP-30476-- genrating birthdate with regex #1291

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
inputJson = inputJson.replace("$UIN$", uin);
inputJson = inputJson.replace("$RID$", genRid);
String phoneNumber = "";
String dateOfBirth = "";
if (inputJson.contains("$PHONENUMBERFORIDENTITY$")) {
if (!phoneSchemaRegex.isEmpty())
try {
Expand All @@ -120,6 +121,16 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
}
inputJson = replaceKeywordWithValue(inputJson, "$PHONENUMBERFORIDENTITY$", phoneNumber);
}

if (inputJson.contains("$DOB$")) {
if (!dateOfBirthSchemaRegex.isEmpty())
try {
dateOfBirth = genStringAsperRegex(dateOfBirthSchemaRegex);
} catch (Exception e) {
logger.error(e.getMessage());
}
inputJson = replaceKeywordWithValue(inputJson, "$DOB$", dateOfBirth);
}

response = postWithBodyAndCookie(ApplnURI + testCaseDTO.getEndPoint(), inputJson, COOKIENAME,
testCaseDTO.getRole(), testCaseDTO.getTestCaseName());
Expand Down
58 changes: 29 additions & 29 deletions apitest/src/main/resources/resident/AddIdentity/AddIdentity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -40,7 +40,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "Resident_AddIdentity_withValidParameters_maximum_email_character_smoke_Pos11111111111111@mosip.net",
"phone": "9876543210",
Expand Down Expand Up @@ -68,7 +68,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -96,7 +96,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -124,7 +124,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -152,7 +152,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -180,7 +180,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -208,7 +208,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -236,7 +236,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -266,7 +266,7 @@ AddIdentity:
"biometricReferenceId": "23452353",
"IDSchemaVersion": "$SCHEMAVERSION$",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -296,7 +296,7 @@ AddIdentity:
"biometricReferenceId": "23452353",
"IDSchemaVersion": "$SCHEMAVERSION$",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -326,7 +326,7 @@ AddIdentity:
"biometricReferenceId": "23452353",
"IDSchemaVersion": "$SCHEMAVERSION$",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "Resident_AddIdentity_ValidParameters_ChannelVerify_smoke_Pos@mosip.net",
"phone": "9876543210",
Expand Down Expand Up @@ -355,7 +355,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -384,7 +384,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -413,7 +413,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -442,7 +442,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -471,7 +471,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -500,7 +500,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -529,7 +529,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -558,7 +558,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -587,7 +587,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -616,7 +616,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -645,7 +645,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
Expand Down Expand Up @@ -707,7 +707,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "Resident_AddIdentity_withValidParameters_To_Genrate_VID_Six_smoke_Pos@mosip.net",
"phone": "9876543210",
Expand Down Expand Up @@ -736,7 +736,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "Resident_AddIdentity_withValidParameters_ToCreate_PreVid_smoke_Pos@mosip.net",
"phone": "9876543210",
Expand Down Expand Up @@ -765,7 +765,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "Resident_AddIdentity_withValidParameters_ToCreate_Three_PreVid_smoke_Pos@mosip.net",
"phone": "9876543210",
Expand Down Expand Up @@ -794,7 +794,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "Resident_AddIdentity_withValidParameters_To_Genrate_TempVid_Use_3_smoke_Pos@mosip.net",
"phone": "9876543210",
Expand Down Expand Up @@ -823,7 +823,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "Resident_AddIdentity_withValidParameters_For_SendOtp_smoke_Pos@mosip.net",
"phone": "9876543210",
Expand Down Expand Up @@ -852,7 +852,7 @@ AddIdentity:
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"dateOfBirth": "$DOB$",
"postalCode": "14022",
"email": "Resident_AddIdentity_withValidParameters_To_Check_Ten_Transactions_smoke_Pos@mosip.net",
"phone": "9876543210",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ AuthHistory:
"requesttime": "$TIMESTAMP$",
"id": "mosip.resident.authhistory",
"version": "v1",
"otp": "$ID:AddIdentity_ValidParameters_ChannelVerify_smoke_Pos_EMAIL$",
"otp": "$ID:AddIdentity_ValidParameters_ChannelVerify_smoke_Pos_PHONE$@phone",
"sendOtp":{
"transactionID": "$TRANSACTIONID$",
"requestTime": "$TIMESTAMP$",
Expand Down
45 changes: 44 additions & 1 deletion apitest/src/main/resources/resident/AuthLock/createAuthLock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,48 @@ AuthLock:
}
}'

Resident_AuthLock_Valid_UIN_EmptyChannel_Neg:
endPoint: /resident/v1/req/auth-lock
role: resident
restMethod: post
checkErrorsOnlyInResponse: true
inputTemplate: resident/AuthLock/createAuthLock
outputTemplate: resident/error
input: '{
"transactionID": "$TRANSACTIONID$",
"individualId": "$ID:AddIdentity_ValidParameters_ChannelVerify_smoke_Pos_UIN$",
"individualIdType": "UIN",
"requesttime": "$TIMESTAMP$",
"id": "mosip.resident.authlock",
"version": "v1",
"authType": [{auth: "bio-Iris"},{auth: "demo"},{auth: "bio-FACE"}],
"otp": "$ID:AddIdentity_ValidParameters_ChannelVerify_smoke_Pos_EMAIL$",
"sendOtp":{
"transactionID": "$TRANSACTIONID$",
"requestTime": "$TIMESTAMP$",
"individualId": "$ID:AddIdentity_ValidParameters_ChannelVerify_smoke_Pos_UIN$",
"individualIdType": "UIN",
"sendOtpReqTemplate": "resident/SendOTP/createSendOTPAsEmpty",
"sendOtpEndPoint": "/resident/v1/req/otp"
}
}'
output: '{
"errors": [
{
"errorCode": "RES-SER-410"
}
],
"sendOtpResp":{
"errors": [
{
"errorCode": "IDA-OTA-008",
"message": "$IGNORE$"
}
],
"sendOtpResTemplate":"resident/error"
}
}'

Resident_AuthLock_Valid_UIN_Phone_All:
endPoint: /resident/v1/req/auth-lock
role: resident
Expand All @@ -1159,7 +1201,7 @@ AuthLock:
"id": "mosip.resident.authlock",
"version": "v1",
"authType": [{auth: "bio-Iris"},{auth: "demo"},{auth: "bio-FACE"}],
"otp": "$ID:AddIdentity_ValidParameters_ChannelVerify_smoke_Pos_EMAIL$",
"otp": "$ID:AddIdentity_ValidParameters_ChannelVerify_smoke_Pos_PHONE$@phone",
"sendOtp":{
"transactionID": "$TRANSACTIONID$",
"requestTime": "$TIMESTAMP$",
Expand Down Expand Up @@ -1208,6 +1250,7 @@ AuthLock:
}
}'


Resident_AuthLock_Valid_UIN_EmptyChannel_Invalid_Neg:
endPoint: /resident/v1/req/auth-lock
role: resident
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,11 @@ AuthUnlock:
"errors": [
{
"errorCode": "RES-SER-410",
<<<<<<< HEAD
"message": "Invalid Input Parameter- otp"
=======
"message": "OTP is invalid"
>>>>>>> upstream/develop
}
],
"sendOtpResp":{
Expand Down Expand Up @@ -1717,7 +1721,7 @@ AuthUnlock:
"id": "mosip.resident.authunlock",
"version": "v1",
"authType": [{auth: "bio-Iris"},{auth: "demo"},{auth: "bio-FACE"}],
"otp": "$ID:AddIdentity_ValidParameters_ChannelVerify_smoke_Pos_EMAIL$",
"otp": "$ID:AddIdentity_ValidParameters_ChannelVerify_smoke_Pos_PHONE$@phone",
"sendOtp":{
"transactionID": "$TRANSACTIONID$",
"requestTime": "$TIMESTAMP$",
Expand Down
Loading
Loading