Skip to content

Commit

Permalink
Merge pull request #1516 from mohanachandran-s/develop
Browse files Browse the repository at this point in the history
MOSIP-34117 - Fixed master data failures
  • Loading branch information
lsivanand authored Jul 8, 2024
2 parents 2c7afcd + 8b7c280 commit d4bf16d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2036,14 +2036,14 @@ protected Response getWithPathParamAndCookie(String url, String jsonInput, boole
GlobalConstants.ERROR_STRING_1 + jsonInput + GlobalConstants.EXCEPTION_STRING_1 + e.getMessage());
}

if (map.containsKey(GlobalConstants.HEADERTRANSACTIONID)) {
if (map != null && map.containsKey(GlobalConstants.HEADERTRANSACTIONID)) {
headerTransactionID = map.get(GlobalConstants.HEADERTRANSACTIONID).toString();
cookiesMap.put(GlobalConstants.TRANSACTION_ID_KEY, headerTransactionID);
cookiesMap.put(GlobalConstants.XSRF_TOKEN, token);
map.remove(GlobalConstants.HEADERTRANSACTIONID);
}

if (map.containsKey(GlobalConstants.VERIFIEDTRANSACTIONID)) {
if (map != null && map.containsKey(GlobalConstants.VERIFIEDTRANSACTIONID)) {
headerTransactionID = map.get(GlobalConstants.VERIFIEDTRANSACTIONID).toString();
cookiesMap.put(GlobalConstants.VERIFIED_TRANSACTION_ID_KEY, headerTransactionID);
cookiesMap.put(GlobalConstants.XSRF_TOKEN, token);
Expand Down Expand Up @@ -3175,6 +3175,7 @@ public String inputJsonKeyWordHandeler(String jsonString, String testCaseName) {

// Need to handle int replacement
if (jsonString.contains("$HIERARCHYLEVEL$"))
getLocationData();
jsonString = replaceKeywordWithValue(jsonString, "$HIERARCHYLEVEL$", String.valueOf(hierarchyLevel));

if (jsonString.contains("$HIERARCHYNAME$"))
Expand Down Expand Up @@ -7111,4 +7112,4 @@ public String getPasswordPattern() {
return password;
}

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

package io.mosip.testrig.apirig.utils;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

import org.apache.log4j.Logger;
Expand All @@ -19,28 +21,48 @@ public static void main(String[] args) {

static String getLanguageID(String langIsoCode) {

String v = "Any-Any";

try {
//String filename = "D:\\Mosip_Automation_Test\\Mosip_Functional_Test_Develop\\mosip-functional-tests\\automationtests\\src\\main\\resources\\config\\lang-isocode-transid.csv";
String filename = MosipTestRunner.getGlobalResourcePath() + "/"+"config/lang-isocode-transid.csv";
//CSVHelper csv = new CSVHelper(IDlookupFile);
CSVHelper csv = new CSVHelper(filename);
String[] rec;
csv.open();
while ((rec = csv.readRecord()) != null) {
if (rec[0].toLowerCase().equals(langIsoCode.toLowerCase())) {
String val = rec[2].trim();
if (val.equals(""))
v = val;
break;
}
}
csv.close();
} catch (IOException e) {
logger.error(e.getMessage());
}
return v;
String value = "Any-Any";

String filename = MosipTestRunner.getGlobalResourcePath() + "/"+"config/lang-isocode-transid.csv";

try (BufferedReader br = new BufferedReader(new FileReader(filename))) {
String line;
while ((line = br.readLine()) != null) {
String[] rec = line.split(",");

// Processing each record
if (rec.length >= 3 && rec[0].toLowerCase().equals(langIsoCode.toLowerCase())) {
value = rec[2].trim();
if (!value.equals("")) {
System.out.println("Value found for translation: " + value);
break;
}
}
}
} catch (IOException e) {
e.printStackTrace();
}

// try {
// //String filename = "D:\\Mosip_Automation_Test\\Mosip_Functional_Test_Develop\\mosip-functional-tests\\automationtests\\src\\main\\resources\\config\\lang-isocode-transid.csv";
// String filename = MosipTestRunner.getGlobalResourcePath() + "/"+"config/lang-isocode-transid.csv";
// //CSVHelper csv = new CSVHelper(IDlookupFile);
// CSVHelper csv = new CSVHelper(filename);
// String[] rec;
// csv.open();
// while ((rec = csv.readRecord()) != null) {
// if (rec[0].toLowerCase().equals(langIsoCode.toLowerCase())) {
// String val = rec[2].trim();
// if (val.equals(""))
// v = val;
// break;
// }
// }
// csv.close();
// } catch (IOException e) {
// logger.error(e.getMessage());
// }
return value;
}

public static String translate(String toLanguageIsoCode, String text) {
Expand Down

0 comments on commit d4bf16d

Please sign in to comment.