From 615d67ad4d94b7f19ef2b713e416d7f5e0b780aa Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Mon, 17 Jun 2024 12:07:18 +0530 Subject: [PATCH] ES-1319 Signed-off-by: Nandhukumar --- .../apirig/kernel/util/ConfigManager.java | 17 ++++++++++++++++- .../apirig/testscripts/GetWithParam.java | 2 +- .../PostWithAutogenIdWithOtpGenerate.java | 4 ++-- .../testrig/apirig/testscripts/SimplePost.java | 2 +- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/automationtests/src/main/java/io/mosip/testrig/apirig/kernel/util/ConfigManager.java b/automationtests/src/main/java/io/mosip/testrig/apirig/kernel/util/ConfigManager.java index af783cc265..d04255c5e0 100644 --- a/automationtests/src/main/java/io/mosip/testrig/apirig/kernel/util/ConfigManager.java +++ b/automationtests/src/main/java/io/mosip/testrig/apirig/kernel/util/ConfigManager.java @@ -75,6 +75,8 @@ public class ConfigManager { private static String USEPRECONFIGOTP = "usePreConfiguredOtp"; private static String ESIGNET_BASE_URL = "eSignetbaseurl"; + + private static String SIGNUP_BASE_URL = "signupBaseUrl"; private static String ESIGNET_MOCK_BASE_URL = "esignetMockBaseURL"; @@ -197,6 +199,7 @@ public class ConfigManager { private static String usePreConfiguredOtp; private static String preconfiguredOtp; private static String eSignetbaseurl; + private static String signupBaseUrl; private static String esignetMockBaseURL; private static String dbPort; @@ -406,7 +409,14 @@ public static void init() { eSignetbaseurl = System.getProperty("env.endpoint").replace("-internal", ""); } propsKernel.setProperty(ESIGNET_BASE_URL, eSignetbaseurl); - + + if (System.getenv(SIGNUP_BASE_URL) != null) { + signupBaseUrl = System.getenv(SIGNUP_BASE_URL); + } else { + signupBaseUrl = System.getProperty("env.endpoint"); + } + propsKernel.setProperty(SIGNUP_BASE_URL, signupBaseUrl); + esignetMockBaseURL = System.getenv(ESIGNET_MOCK_BASE_URL) == null ? propsKernel.getProperty(ESIGNET_MOCK_BASE_URL) : System.getenv(ESIGNET_MOCK_BASE_URL); @@ -530,6 +540,11 @@ public static String getEsignetBaseUrl() { return eSignetbaseurl; } + + public static String getSignupBaseUrl() { + return signupBaseUrl; + + } public static String getEsignetMockBaseURL() { return esignetMockBaseURL; diff --git a/automationtests/src/main/java/io/mosip/testrig/apirig/testscripts/GetWithParam.java b/automationtests/src/main/java/io/mosip/testrig/apirig/testscripts/GetWithParam.java index 00fdd35782..f2b243e1ab 100644 --- a/automationtests/src/main/java/io/mosip/testrig/apirig/testscripts/GetWithParam.java +++ b/automationtests/src/main/java/io/mosip/testrig/apirig/testscripts/GetWithParam.java @@ -133,7 +133,7 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad if (testCaseName.contains("ESignet_")) { String tempUrl = ConfigManager.getEsignetBaseUrl(); if (testCaseDTO.getEndPoint().contains("/signup/")) - tempUrl = ApplnURI; + tempUrl = ConfigManager.getSignupBaseUrl(); response = getWithPathParamAndCookie(tempUrl + testCaseDTO.getEndPoint(), getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()), COOKIENAME, diff --git a/automationtests/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java b/automationtests/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java index 9a11cb58d5..15fe1f65db 100644 --- a/automationtests/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java +++ b/automationtests/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java @@ -156,7 +156,7 @@ public void test(TestCaseDTO testCaseDTO) String tempUrl = ConfigManager.getEsignetBaseUrl(); if (testCaseDTO.getEndPoint().contains("/signup/")) - tempUrl = ApplnURI; + tempUrl = ConfigManager.getSignupBaseUrl(); otpResponse = postRequestWithCookieAuthHeaderAndXsrfToken(tempUrl + sendOtpEndPoint, getJsonFromTemplate(otpReqJson.toString(), sendOtpReqTemplate), COOKIENAME, testCaseDTO.getTestCaseName()); @@ -217,7 +217,7 @@ public void test(TestCaseDTO testCaseDTO) String tempUrl = ConfigManager.getEsignetBaseUrl(); if (testCaseDTO.getEndPoint().contains("/signup/")) - tempUrl = ApplnURI; + tempUrl = ConfigManager.getSignupBaseUrl(); if (testCaseName.startsWith("ESignet_VerifyChallengeNegTC_") || testCaseName.startsWith("ESignet_VerifyChallengeForResetPasswordNegTC_")) { response = postRequestWithCookieAuthHeaderAndXsrfToken(tempUrl + testCaseDTO.getEndPoint(), diff --git a/automationtests/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java b/automationtests/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java index 56bc54b995..6e835a8229 100644 --- a/automationtests/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java +++ b/automationtests/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java @@ -163,7 +163,7 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad String tempUrl = ConfigManager.getEsignetBaseUrl(); if (testCaseDTO.getEndPoint().contains("/signup/")) - tempUrl = ApplnURI; + tempUrl = ConfigManager.getSignupBaseUrl(); if (testCaseName.contains("ESignet_")) { if (testCaseDTO.getEndPoint().startsWith("$ESIGNETMOCKBASEURL$") && testCaseName.contains("SunBirdRC")) {