Skip to content

Commit

Permalink
MOSIP-35982
Browse files Browse the repository at this point in the history
Signed-off-by: Sohan Kumar Dey <72375959+Sohandey@users.noreply.github.com>
  • Loading branch information
Sohandey committed Sep 24, 2024
1 parent 4b8fbd9 commit ec7f140
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ec7f140

Please sign in to comment.