Skip to content

Commit

Permalink
Merge pull request #1235 from nandhu-kumar/camdgc-develop
Browse files Browse the repository at this point in the history
MOSIP-30312
  • Loading branch information
Sohandey authored Dec 5, 2023
2 parents 439ebec + faf496b commit f4a55f8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5840,10 +5840,25 @@ else if (testCaseName.startsWith("IdRepository_") && testCaseName.contains("Inva
} else if (BaseTestCase.currentModule.equalsIgnoreCase(GlobalConstants.AUTH)) {
if (testCaseName.startsWith("auth_")
&& (testCaseName.contains("_BioAuth_") || testCaseName.contains("_EkycBio_")
|| testCaseName.contains("_MultiFactorAuth_") || testCaseName.contains("_DemoAuth_")
|| testCaseName.contains("_MultiFactorAuth_") || testCaseName.contains("_DemoAuth")
|| testCaseName.contains("_EkycDemo_"))
&& (!isElementPresent(new JSONArray(schemaRequiredField), individualBiometrics))) {
throw new SkipException(GlobalConstants.FEATURE_NOT_SUPPORTED_MESSAGE);
} else if (testCaseName.startsWith("auth_") && (testCaseName.contains("_DeactivateUINs_"))
&& (!BaseTestCase.getSupportedIdTypesValueFromActuator().contains("VID")
&& !BaseTestCase.getSupportedIdTypesValueFromActuator().contains("vid"))) {
throw new SkipException(GlobalConstants.VID_FEATURE_NOT_SUPPORTED);
} else if (testCaseName.startsWith("auth_")
&& (testCaseName.contains("_AuthLock_") || testCaseName.contains("_AuthUnLock_"))
&& (ConfigManager.isInServiceNotDeployedList(GlobalConstants.RESIDENT))) {
throw new SkipException(GlobalConstants.SERVICE_NOT_DEPLOYED_MESSAGE);
} else if (testCaseName.startsWith("auth_")
&& (testCaseName.contains("_BlockHotlistAPI_") || testCaseName.contains("_HotlistAPI_")
|| testCaseName.contains("_BlockPartnerId_")
|| testCaseName.contains("_OTP_Auth_With_blocked_misp_Pos")
|| testCaseName.contains("_OTP_Auth_With_blocked_partnerid_Pos"))
&& (ConfigManager.isInServiceNotDeployedList(GlobalConstants.HOTLIST))) {
throw new SkipException(GlobalConstants.SERVICE_NOT_DEPLOYED_MESSAGE);
}
} else if (BaseTestCase.currentModule.equalsIgnoreCase(GlobalConstants.ESIGNET)) {
if ((testCaseName.startsWith("Esignet_") || testCaseName.startsWith("ESignet_"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,5 @@ public class GlobalConstants {
public static final String IGNORED_SUBSET_STRING = "feature not supported;Service not deployed";
public static final String SKIPPED = "Skipped";
public static final String TARGET_ENV_HEALTH_CHECK_FAILED = "Target env health check failed ";
public static final String HOTLIST = "hotlist";
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad

requestBody.put("id", individualId);
requestBody.put("keyFileNameByPartnerName", GlobalConstants.TRUE_STRING);
requestBody.put("partnerName", PartnerRegistration.partnerId);
if (testCaseName.startsWith("auth_EkycOtp_")) {
requestBody.put("partnerName", PartnerRegistration.ekycPartnerId);
}else {
requestBody.put("partnerName", PartnerRegistration.partnerId);
}
requestBody.put("moduleName", BaseTestCase.certsForModule);
requestBody.put(GlobalConstants.TRANSACTIONID, "$TRANSACTIONID$");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,21 @@ public void updateIdentity(TestCaseDTO testCaseDTO) throws AuthenticationTestExc

inputJson = inputJson.replace("$RID$", genRid);

if (testCaseName.startsWith("IdRepository_") && inputJson.contains("dateOfBirth") && (!isElementPresent(new JSONArray(schemaRequiredField), dob))) {
if ((testCaseName.startsWith("IdRepository_") || testCaseName.startsWith("auth_"))
&& inputJson.contains("dateOfBirth") && (!isElementPresent(new JSONArray(schemaRequiredField), dob))) {
JSONObject reqJson = new JSONObject(inputJson);
reqJson.getJSONObject("request").getJSONObject("identity").remove("dateOfBirth");
inputJson = reqJson.toString();
}

if (testCaseName.startsWith("IdRepository_") && inputJson.contains("email") && (!isElementPresent(new JSONArray(schemaRequiredField), emailResult))) {
if ((testCaseName.startsWith("IdRepository_") || testCaseName.startsWith("auth_"))
&& inputJson.contains("email")
&& (!isElementPresent(new JSONArray(schemaRequiredField), emailResult))) {
JSONObject reqJson = new JSONObject(inputJson);
reqJson.getJSONObject("request").getJSONObject("identity").remove(emailResult);
reqJson.getJSONObject("request").getJSONObject("identity").remove(result);
if (reqJson.getJSONObject("request").getJSONObject("identity").has(result)) {
reqJson.getJSONObject("request").getJSONObject("identity").remove(result);
}
inputJson = reqJson.toString();
}

Expand Down

0 comments on commit f4a55f8

Please sign in to comment.