Skip to content

Commit

Permalink
Merge pull request #1150 from mosip/Sohandey-patch-5
Browse files Browse the repository at this point in the history
Update DemoAuthSimplePostForAutoGenId.java
  • Loading branch information
Sohandey authored Oct 19, 2023
2 parents 2ebbcc6 + 2072bd5 commit 5561986
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ public void test(TestCaseDTO testCaseDTO)
String[] templateFields = testCaseDTO.getTemplateFields();

String inputJson = getJsonFromTemplate(input, testCaseDTO.getInputTemplate());
//Added for dsl demoauth request body changes
String phone = getValueFromAuthActuator("json-property", "phone_number");
String result = phone.replaceAll("\\[\"|\"\\]", "");
String email = getValueFromAuthActuator("json-property", "emailId");
String emailResult = email.replaceAll("\\[\"|\"\\]", "");
inputJson = inputJson.replace("\"phone\":", "\"" + result + "\":");
inputJson = inputJson.replace("\"email\":", "\"" + emailResult + "\":");

String outputJson = getJsonFromTemplate(testCaseDTO.getOutput(), testCaseDTO.getOutputTemplate());

if (testCaseDTO.getTemplateFields() != null && templateFields.length > 0) {
Expand Down

0 comments on commit 5561986

Please sign in to comment.