From 8e07d3e75156eb7dbf44301a8c5e1814d7d89756 Mon Sep 17 00:00:00 2001 From: neeharikatech <76684248+neeharikatech@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:46:11 +0530 Subject: [PATCH 1/4] Mandatory lang not present handke --- .../testrig/apirig/service/BaseTestCase.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java b/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java index be5e6c16379..ac43d6109a4 100644 --- a/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java +++ b/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java @@ -547,23 +547,30 @@ public static List getLanguageList() { return languageList; } String section = ""; - + String optionalLanguages=null; + String mandatoryLanguages=null; if (isTargetEnvLTS()) section = "/mosip/mosip-config/application-default.properties"; else section = "/mosip/mosip-config/sandbox/admin-mz.properties"; - - String mandatoryLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"), - section, "mosip.mandatory-languages"); - String optionalLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"), + try { + + optionalLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"), section, "mosip.optional-languages"); - + logger.info("optionalLanguages from env:" + optionalLanguages); + mandatoryLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"), + section, "mosip.mandatoryLanguages from env:" + mandatoryLanguages); + } + catch(Exception e) + { + e.printStackTrace(); + } if (mandatoryLanguages != null && !mandatoryLanguages.isBlank()) languageList.addAll(Arrays.asList(mandatoryLanguages.split(","))); if (optionalLanguages != null && !optionalLanguages.isBlank()) languageList.addAll(Arrays.asList(optionalLanguages.split(","))); - + logger.info("languageList from env:" + languageList); return languageList; } From 35a4061c9b80cd5ff3a2107527d2a3d89e6aea00 Mon Sep 17 00:00:00 2001 From: neeharikatech <76684248+neeharikatech@users.noreply.github.com> Date: Mon, 25 Sep 2023 15:22:46 +0530 Subject: [PATCH 2/4] Mandatory lang not present handke --- .../io/mosip/testrig/apirig/service/BaseTestCase.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java b/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java index ac43d6109a4..b882a153e91 100644 --- a/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java +++ b/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java @@ -523,8 +523,11 @@ public static String getValueFromActuators(String endPoint, String section, Stri GlobalMethods.reportResponse(response.getHeaders().asList().toString(), url, response); responseJson = new org.json.JSONObject(response.getBody().asString()); + logger.info("responseJson:" +responseJson); responseArray = responseJson.getJSONArray("propertySources"); - + logger.info("responseArray:" +responseArray); + logger.info("responseArray.length()" + responseArray.length()); + logger.info("endPoint="+endPoint +" section= "+section+" key= "+key); for (int i = 0, size = responseArray.length(); i < size; i++) { org.json.JSONObject eachJson = responseArray.getJSONObject(i); if (eachJson.get("name").toString().contains(section)) { @@ -558,9 +561,11 @@ public static List getLanguageList() { optionalLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"), section, "mosip.optional-languages"); logger.info("optionalLanguages from env:" + optionalLanguages); - mandatoryLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"), - section, "mosip.mandatoryLanguages from env:" + mandatoryLanguages); + mandatoryLanguages = getValueFromActuators(propsKernel.getProperty("actuatorAdminEndpoint"), + section, "mosip.mandatory-languages"); + logger.info("mandatoryLanguages from env:" + mandatoryLanguages); } + catch(Exception e) { e.printStackTrace(); From 14192bd6c37eed45f2c1cfdd6b98a6b1e4024ea9 Mon Sep 17 00:00:00 2001 From: neeharikatech <76684248+neeharikatech@users.noreply.github.com> Date: Mon, 25 Sep 2023 15:24:40 +0530 Subject: [PATCH 3/4] Mandatory lang not present handke --- .../main/java/io/mosip/testrig/apirig/service/BaseTestCase.java | 1 + 1 file changed, 1 insertion(+) diff --git a/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java b/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java index b882a153e91..a8a5c1d01b2 100644 --- a/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java +++ b/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java @@ -533,6 +533,7 @@ public static String getValueFromActuators(String endPoint, String section, Stri if (eachJson.get("name").toString().contains(section)) { value = eachJson.getJSONObject(GlobalConstants.PROPERTIES).getJSONObject(key) .get(GlobalConstants.VALUE).toString(); + logger.info("value="+value); break; } } From 24055e9de9c021d79b0109c30b53f7874985cf57 Mon Sep 17 00:00:00 2001 From: neeharikatech <76684248+neeharikatech@users.noreply.github.com> Date: Mon, 25 Sep 2023 15:45:14 +0530 Subject: [PATCH 4/4] resolve conflict --- .../java/io/mosip/testrig/apirig/service/BaseTestCase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java b/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java index 8c1724a22f1..9a7e5594544 100644 --- a/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java +++ b/automationtests/src/main/java/io/mosip/testrig/apirig/service/BaseTestCase.java @@ -527,13 +527,14 @@ public static String getValueFromActuators(String endPoint, String section, Stri responseJson = new org.json.JSONObject(response.getBody().asString()); idaActuatorResponseArray = responseJson.getJSONArray("propertySources"); } - + logger.info("idaActuatorResponseArray="+idaActuatorResponseArray); for (int i = 0, size = idaActuatorResponseArray.length(); i < size; i++) { org.json.JSONObject eachJson = idaActuatorResponseArray.getJSONObject(i); if (eachJson.get("name").toString().contains(section)) { value = eachJson.getJSONObject(GlobalConstants.PROPERTIES).getJSONObject(key) .get(GlobalConstants.VALUE).toString(); + logger.info("value="+value); break; } }