Skip to content

Commit

Permalink
added array handle code
Browse files Browse the repository at this point in the history
Signed-off-by: Sohan Kumar Dey <[email protected]>
  • Loading branch information
Sohandey committed Aug 21, 2024
1 parent ce23875 commit a75e32a
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
inputJson = inputJson.replace("$UIN$", uin);
inputJson = inputJson.replace("$RID$", genRid);
String phoneNumber = "";
String email = testCaseName +"@mosip.net";
if (inputJson.contains("$PHONENUMBERFORIDENTITY$")) {
if (!phoneSchemaRegex.isEmpty())
try {
Expand All @@ -143,6 +144,8 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
logger.error(e.getMessage());
}
inputJson = replaceKeywordWithValue(inputJson, "$PHONENUMBERFORIDENTITY$", phoneNumber);
inputJson = replaceKeywordWithValue(inputJson, "$EMAILVALUE$", email);

}

response = postWithBodyAndCookie(ApplnURI + testCaseDTO.getEndPoint(), inputJson, COOKIENAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,46 +90,9 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
throw new SkipException(GlobalConstants.VID_FEATURE_NOT_SUPPORTED);
}
}

String jsonInput = testCaseDTO.getInput();

if (BaseTestCase.languageList.size() == 2) {
jsonInput = jsonInput.replace(", { \"language\": \"$3RDLANG$\", \"value\": \"FR\" }", "");
jsonInput = jsonInput.replace(", { \"language\": \"$3RDLANG$\", \"value\": \"Female\" }", "");
jsonInput = jsonInput.replace(", { \"language\": \"$3RDLANG$\", \"value\": \"Mrs Lisa.GN\" }", "");
jsonInput = jsonInput.replace(", { \"language\": \"$3RDLANG$\", \"value\": \"Line1\" }", "");
jsonInput = jsonInput.replace(", { \"language\": \"$3RDLANG$\", \"value\": \"Line2\" }", "");
jsonInput = jsonInput.replace(", { \"language\": \"$3RDLANG$\", \"value\": \"Line3\" }", "");
} else if (BaseTestCase.languageList.size() == 1) {
jsonInput = jsonInput.replace(
", { \"language\": \"$2NDLANG$\", \"value\": \"FR\" }, { \"language\": \"$3RDLANG$\", \"value\": \"FR\" }",
"");
jsonInput = jsonInput.replace(
", { \"language\": \"$2NDLANG$\", \"value\": \"Female\" }, { \"language\": \"$3RDLANG$\", \"value\": \"Female\" }",
"");
jsonInput = jsonInput.replace(
", { \"language\": \"$2NDLANG$\", \"value\": \"Mrs Lisa.GN\" }, { \"language\": \"$3RDLANG$\", \"value\": \"Mrs Lisa.GN\" }",
"");
jsonInput = jsonInput.replace(
", { \"language\": \"$2NDLANG$\", \"value\": \"Line1\" }, { \"language\": \"$3RDLANG$\", \"value\": \"Line1\" }",
"");
jsonInput = jsonInput.replace(
", { \"language\": \"$2NDLANG$\", \"value\": \"Line2\" }, { \"language\": \"$3RDLANG$\", \"value\": \"Line2\" }",
"");
jsonInput = jsonInput.replace(
", { \"language\": \"$2NDLANG$\", \"value\": \"Line3\" }, { \"language\": \"$3RDLANG$\", \"value\": \"Line3\" }",
"");
}

String inputJson = getJsonFromTemplate(jsonInput, testCaseDTO.getInputTemplate(), false);

if (inputJson.contains("$1STLANG$"))
inputJson = inputJson.replace("$1STLANG$", BaseTestCase.languageList.get(0));
if (inputJson.contains("$2NDLANG$"))
inputJson = inputJson.replace("$2NDLANG$", BaseTestCase.languageList.get(1));
if (inputJson.contains("$3RDLANG$"))
inputJson = inputJson.replace("$3RDLANG$", BaseTestCase.languageList.get(2));

response = patchWithPathParamsBodyAndCookie(ApplnURI + testCaseDTO.getEndPoint(), inputJson, COOKIENAME,
testCaseDTO.getRole(), testCaseDTO.getTestCaseName(), pathParams);

Expand Down
64 changes: 29 additions & 35 deletions apitest/src/main/resources/config/Kernel.properties
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,17 @@ AuthClientID = mosip-resident-client

#---------------------------------- Client Secret Keys -----------------------#
#-- When test rig ran in docker, these values dervied from the environment ---#
mosip_partner_client_secret =
mosip_pms_client_secret =
mosip_resident_client_secret =
mosip_idrepo_client_secret =
mosip_reg_client_secret =
mosip_admin_client_secret =
mosip_hotlist_client_secret =
mosip_regproc_client_secret =
mpartner_default_mobile_secret =
mosip_testrig_client_secret =
AuthClientSecret =
mosip_partner_client_secret = w6z9XQQ6Toi5vzzY
mosip_pms_client_secret = 3XiMpmPfAAzT47EC
mosip_resident_client_secret = MiTOjWLVoFZw3CHZ
mosip_idrepo_client_secret = qKNTW5CTxKsgVGjw
mosip_reg_client_secret = Msc7sItq6Rg8vcEC
mosip_admin_client_secret = auWjWiniqX0YX8KF
mosip_hotlist_client_secret = lA7pCSLknLvT9Owj
mosip_regproc_client_secret = rR5eKHfG4i3BJf8S
mpartner_default_mobile_secret = duo1HolnpqNc6aMA
mosip_testrig_client_secret = G9qAJ3SrOm575GqL
AuthClientSecret = FeTFpxitRJC4IUiq



Expand All @@ -168,17 +168,16 @@ new_Resident_Password = mosip123
new_Resident_Role = default-roles-mosip,PARTNER_ADMIN
roles.111995 = PARTNER_ADMIN,default-roles-mosip
keycloak_UserName = admin
keycloak_Password =
keycloak-external-url = https://iam.qa1-java21.mosip.net
keycloak_Password = DyWRaJqTFh
keycloak-external-url = https://iam.released.mosip.net
keycloak-realm-id = mosip
iam-users-to-create=111997,111998,220005,111992,globaladmin,111999,111887
iam-users-password=mosip123,mosip123,mosip123,mosip123,mosip123,mosip123,mosip123
roles.220005=GLOBAL_ADMIN,ID_AUTHENTICATION,REGISTRATION_ADMIN,REGISTRATION_SUPERVISOR,ZONAL_ADMIN
roles.111997=AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR
roles.111999=AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR
roles.111887=AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,REGISTRATION_SUPERVISOR
roles.111998=POLICYMANAGER
roles.111992=GLOBAL_ADMIN
iam-users-to-create = 111997,111998,220005,111992,globaladmin,111887
iam-users-password = mosip123,mosip123,mosip123,mosip123,mosip123
roles.220005 = GLOBAL_ADMIN,ID_AUTHENTICATION,REGISTRATION_ADMIN,REGISTRATION_SUPERVISOR,ZONAL_ADMIN
roles.111997 = AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR
roles.111887 = AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,REGISTRATION_SUPERVISOR
roles.111998 = POLICYMANAGER
roles.111992 = GLOBAL_ADMIN
roles.globaladmin = GLOBAL_ADMIN,REGISTRATION_ADMIN,uma_authorization,ZONAL_ADMIN,default-roles-mosip


Expand All @@ -189,27 +188,27 @@ pool_size=1
dialect=org.hibernate.dialect.PostgreSQLDialect
show_sql=true
current_session_context_class=thread
audit_url=jdbc:postgresql://qa1-java21.mosip.net:5432/mosip_audit
audit_url=jdbc:postgresql://released.mosip.net:5432/mosip_audit
audit_username=postgres
audit_password=
audit_password=2BhgiSpCaT
audit_default_schema=audit
DB_PORT=
installation-domain=
partner_url=jdbc:postgresql://qa1-java21.mosip.net:5432/mosip_ida
partner_url=jdbc:postgresql://released.mosip.net:5432/mosip_ida
partner_username=postgres
partner_password=
partner_password=2BhgiSpCaT
partner_default_schema=partner
reportLogPath=automationLogAndReport
postgresqlUser=postgresql
db-port=5432
db-server=qa1-java21.mosip.net
db-server=released.mosip.net
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.connection.pool_size=1
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.show_sql=true
hibernate.current_session_context_class=thread
db-su-user=postgres
postgres-password=
postgres-password=2BhgiSpCaT
pms_db_schema=pms
km_db_schema=keymgr
master_db_schema=master
Expand All @@ -236,11 +235,11 @@ threadCount=1
#------------------------ Generic properties ------------------------#
enableDebug=yes
preconfiguredOtp=111111
usePreConfiguredOtp=false
usePreConfiguredOtp=true
# supported values yes or no. Assume that by Default e-signet is deployed
eSignetDeployed=yes
partnerUrlSuffix=oYf63Lax0DY2QkYMRHnrmDqhmO3RMWQagwm0ftgLlkuin1KOND/666/576732
reportIgnoredTestCases=no
reportIgnoredTestCases=yes
servicesNotDeployed=
esignetMockBaseURL=esignet-insurance.
sunBirdBaseURL=registry
Expand All @@ -249,7 +248,6 @@ serverErrorsToMonitor=IDA-MLC-018
pmsAuthInternal=true
partner_password=mosip123
partner_userName=111997
partner_revamp_userName=111999
partner_user_password=mosip123
policytest_password=mosip123
policytest_userName=111998
Expand Down Expand Up @@ -278,8 +276,4 @@ authCertsPath=
#Uncommemnt the below to run in Docker
#authDemoServiceBaseURL=http://authdemo.apitestrig
#authDemoServicePort=80
#authCertsPath=/home/mosip/authcerts


mosip_components_base_urls=
#auditmanager=api-internal.dev1.mosip.net;idrepository=api-internal.dev1.mosip.net;partnermanager=api-internal.qa-inji.mosip.net;idauthentication=api-internal.qa-inji.mosip.net;policymanager=api-internal.qa-inji.mosip.net
#authCertsPath=/home/mosip/authcerts
20 changes: 10 additions & 10 deletions apitest/src/main/resources/ida/OtpInternalAuth/OtpInternalAuth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ OTPInternalAuth:
"transactionID": "$TRANSACTIONID$",
"maskedMobile": "XXXXXX8538",
"sendOtpResTemplate":"ida/OtpInternalAuth/sendOtpRes",
"maskedEmail": "XXkXXiXXb@technoforte.co.in"
"maskedEmail": "XXkXXiXXb@mailinator.co.in"
}
}'
auth_OTP_Internal_Auth_With_Valid_VID_Smoke_Pos:
Expand Down Expand Up @@ -62,7 +62,7 @@ OTPInternalAuth:
"transactionID": "$TRANSACTIONID$",
"maskedMobile": "XXXXXX8538",
"sendOtpResTemplate":"ida/OtpInternalAuth/sendOtpRes",
"maskedEmail": "XXkXXiXXb@technoforte.co.in"
"maskedEmail": "XXkXXiXXb@mailinator.co.in"
}
}'
auth_OTP_Internal_Auth_With_Invalid_individualId_neg:
Expand Down Expand Up @@ -101,7 +101,7 @@ OTPInternalAuth:
"transactionID": "$TRANSACTIONID$",
"maskedMobile": "XXXXXX8538",
"sendOtpResTemplate":"ida/OtpInternalAuth/sendOtpRes",
"maskedEmail": "XXkXXiXXb@technoforte.co.in"
"maskedEmail": "XXkXXiXXb@mailinator.co.in"
}
}'
auth_OTP_Internal_Auth_With_Blank_individualId_neg:
Expand Down Expand Up @@ -140,7 +140,7 @@ OTPInternalAuth:
"transactionID": "$TRANSACTIONID$",
"maskedMobile": "XXXXXX8538",
"sendOtpResTemplate":"ida/OtpInternalAuth/sendOtpRes",
"maskedEmail": "XXkXXiXXb@technoforte.co.in"
"maskedEmail": "XXkXXiXXb@mailinator.co.in"
}
}'
auth_OTP_Internal_Auth_With_Missing_individualId_neg:
Expand Down Expand Up @@ -179,7 +179,7 @@ OTPInternalAuth:
"transactionID": "$TRANSACTIONID$",
"maskedMobile": "XXXXXX8538",
"sendOtpResTemplate":"ida/OtpInternalAuth/sendOtpRes",
"maskedEmail": "XXkXXiXXb@technoforte.co.in"
"maskedEmail": "XXkXXiXXb@mailinator.co.in"
}
}'
auth_OTP_Internal_Auth_Invalid_transactionId_neg:
Expand Down Expand Up @@ -218,7 +218,7 @@ OTPInternalAuth:
"transactionID": "$TRANSACTIONID$",
"maskedMobile": "XXXXXX8538",
"sendOtpResTemplate":"ida/OtpInternalAuth/sendOtpRes",
"maskedEmail": "XXkXXiXXb@technoforte.co.in"
"maskedEmail": "XXkXXiXXb@mailinator.co.in"
}
}'
auth_OTP_Internal_Auth_Blank_transactionId_neg:
Expand Down Expand Up @@ -257,7 +257,7 @@ OTPInternalAuth:
"transactionID": "$TRANSACTIONID$",
"maskedMobile": "XXXXXX8538",
"sendOtpResTemplate":"ida/OtpInternalAuth/sendOtpRes",
"maskedEmail": "XXkXXiXXb@technoforte.co.in"
"maskedEmail": "XXkXXiXXb@mailinator.co.in"
}
}'
auth_OTP_Internal_Auth_Invalid_individualIdType_neg:
Expand Down Expand Up @@ -296,7 +296,7 @@ OTPInternalAuth:
"transactionID": "$TRANSACTIONID$",
"maskedMobile": "XXXXXX8538",
"sendOtpResTemplate":"ida/OtpInternalAuth/sendOtpRes",
"maskedEmail": "XXkXXiXXb@technoforte.co.in"
"maskedEmail": "XXkXXiXXb@mailinator.co.in"
}
}'
auth_OTP_Internal_Auth_Blank_individualIdType_neg:
Expand Down Expand Up @@ -335,7 +335,7 @@ OTPInternalAuth:
"transactionID": "$TRANSACTIONID$",
"maskedMobile": "XXXXXX8538",
"sendOtpResTemplate":"ida/OtpInternalAuth/sendOtpRes",
"maskedEmail": "XXkXXiXXb@technoforte.co.in"
"maskedEmail": "XXkXXiXXb@mailinator.co.in"
}
}'
auth_OTP_Internal_Auth_Missing_individualIdType_neg:
Expand Down Expand Up @@ -374,6 +374,6 @@ OTPInternalAuth:
"transactionID": "$TRANSACTIONID$",
"maskedMobile": "XXXXXX8538",
"sendOtpResTemplate":"ida/OtpInternalAuth/sendOtpRes",
"maskedEmail": "XXkXXiXXb@technoforte.co.in"
"maskedEmail": "XXkXXiXXb@mailinator.co.in"
}
}'
2 changes: 1 addition & 1 deletion apitest/src/main/resources/ida/SendOTP/createSendOTP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ createSendOTP:
}'
output: '{
"maskedMobile": "$IGNORE$",
"maskedEmail": "XXkXXlXXhXXuXXr@technoforte.co.in"
"maskedEmail": "XXkXXlXXhXXuXXr@mailinator.co.in"
}'

0 comments on commit a75e32a

Please sign in to comment.