Skip to content

Commit

Permalink
MOSIP-35914
Browse files Browse the repository at this point in the history
Signed-off-by: Jayesh Kharode <[email protected]>
  • Loading branch information
Jayesh Kharode committed Nov 27, 2024
2 parents 7f82057 + ef8ce0c commit d7c3299
Show file tree
Hide file tree
Showing 6 changed files with 244 additions and 249 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,25 @@ public class GetResidentData extends BaseTestCaseUtil implements StepInterface {
@Override
public void run() throws RigInternalError {

int nofResident = 1;
String ageCategory = "";
Boolean bSkipGuardian = false;
String missFields = null;
String[] bioFlag = null;
HashMap<String, String> genderAndBioFlag = new HashMap<String, String>();
if (!step.getParameters().isEmpty() && step.getParameters().size() > 3) {
nofResident = Integer.parseInt(step.getParameters().get(0));
ageCategory = step.getParameters().get(1);
bSkipGuardian = Boolean.parseBoolean(step.getParameters().get(2));
if (!step.getParameters().isEmpty() && step.getParameters().size() >= 3) {
ageCategory = step.getParameters().get(0);
bSkipGuardian = Boolean.parseBoolean(step.getParameters().get(1));

if (step.getParameters().get(3).contains("@@")) {
bioFlag = step.getParameters().get(3).split("@@");
if (step.getParameters().get(2).contains("@@")) {
bioFlag = step.getParameters().get(2).split("@@");
genderAndBioFlag.put("Gender", bioFlag[0]);
genderAndBioFlag.put("Iris", bioFlag[1]);
genderAndBioFlag.put("Finger", bioFlag[2]);
genderAndBioFlag.put("Face", bioFlag[3]);

} else {

genderAndBioFlag.put("Gender", step.getParameters().get(3));
genderAndBioFlag.put("Gender", step.getParameters().get(2));
genderAndBioFlag.put("Iris", "true");
genderAndBioFlag.put("Finger", "true");
genderAndBioFlag.put("Face", "true");
Expand All @@ -58,8 +56,8 @@ public void run() throws RigInternalError {

// Get Miss attrobutes list

if (step.getParameters().size() > 4)
missFields = step.getParameters().get(4).replaceAll("@@", ",");
if (step.getParameters().size() > 3)
missFields = step.getParameters().get(3).replaceAll("@@", ",");

} else {
logger.warn("Input parameter missing [nofResident/bAdult/bSkipGuardian/gender]");
Expand Down Expand Up @@ -114,4 +112,4 @@ private void cleanData() {
step.getScenario().getResidentPathsPrid().clear();
step.getScenario().getTemplatePacketPath().clear();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public List<String> generateResidents(int n, Boolean bAdult, Boolean bSkipGuardi

}

public Response generateResident( String ageCategory, Boolean bSkipGuardian, String missFields,
public Response generateResident(String ageCategory, Boolean bSkipGuardian, String missFields,
HashMap<String, String> genderAndBioFlag, Scenario.Step step) throws RigInternalError {

String url = baseUrl + props.getProperty("getResidentUrl");
Expand Down Expand Up @@ -1842,4 +1842,4 @@ public static void closeZipInputStream(ZipInputStream zipInputStream) {
}
}

}
}
Loading

0 comments on commit d7c3299

Please sign in to comment.