diff --git a/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/AdminTestUtil.java b/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/AdminTestUtil.java index 47e113adca..5613300760 100644 --- a/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/AdminTestUtil.java +++ b/apitest-commons/src/main/java/io/mosip/testrig/apirig/utils/AdminTestUtil.java @@ -3102,8 +3102,8 @@ public String inputJsonKeyWordHandeler(String jsonString, String testCaseName) { jsonString = replaceKeywordWithValue(jsonString, "$RID$", genRid); if (jsonString.contains("$SCHEMAVERSION$")) - jsonString = replaceKeywordWithValue(jsonString, "$SCHEMAVERSION$", - String.valueOf(generateLatestSchemaVersion())); + jsonString = replaceKeywordWithValue(jsonString, "$SCHEMAVERSION$", generateLatestSchemaVersion()); + if (jsonString.contains("$PHONENUMBERFORIDENTITY$")) { String phoneNumber = ""; @@ -5398,25 +5398,25 @@ else if (eachRequiredProp.equals("proofOfIdentity")) { } - public static int generateLatestSchemaVersion() { - - kernelAuthLib = new KernelAuthentication(); - String token = kernelAuthLib.getTokenByRole(GlobalConstants.ADMIN); - String url = ApplnURI + properties.getProperty(GlobalConstants.MASTER_SCHEMA_URL); - - Response response = RestClient.getRequestWithCookie(url, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, - GlobalConstants.AUTHORIZATION, token); + + public static String generateLatestSchemaVersion() { + kernelAuthLib = new KernelAuthentication(); + String token = kernelAuthLib.getTokenByRole(GlobalConstants.ADMIN); + String url = ApplnURI + properties.getProperty(GlobalConstants.MASTER_SCHEMA_URL); - org.json.JSONObject responseJson = new org.json.JSONObject(response.asString()); - org.json.JSONObject schemaData = (org.json.JSONObject) responseJson.get(GlobalConstants.RESPONSE); + Response response = RestClient.getRequestWithCookie(url, MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON, + GlobalConstants.AUTHORIZATION, token); - Double schemaVersion = ((BigDecimal) schemaData.get(GlobalConstants.ID_VERSION)).doubleValue(); - int latestSchemaVersion = Double.valueOf(schemaVersion).intValue(); - logger.info(latestSchemaVersion); - return latestSchemaVersion; + org.json.JSONObject responseJson = new org.json.JSONObject(response.asString()); + org.json.JSONObject schemaData = (org.json.JSONObject) responseJson.get(GlobalConstants.RESPONSE); + BigDecimal schemaVersion = schemaData.getBigDecimal(GlobalConstants.ID_VERSION); + String latestSchemaVersion = schemaVersion.toString(); + logger.info(latestSchemaVersion); + return latestSchemaVersion; } + public static String generateHbsForUpdateDraft() { if (draftHbs != null) { return draftHbs;