diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java b/apitest/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java index 377e1ac3..0c886faf 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java @@ -24,8 +24,8 @@ import io.mosip.testrig.apirig.dataprovider.BiometricDataProvider; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.CertsUtil; -import io.mosip.testrig.apirig.utils.ConfigManager; import io.mosip.testrig.apirig.utils.GlobalConstants; +import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager; import io.mosip.testrig.apirig.utils.JWKKeyUtil; import io.mosip.testrig.apirig.utils.KeyCloakUserAndAPIKeyGeneration; import io.mosip.testrig.apirig.utils.KeycloakUserManager; @@ -61,14 +61,16 @@ public static void main(String[] arg) { for (String envName : envMap.keySet()) { LOGGER.info(String.format("ENV %s = %s%n", envName, envMap.get(envName))); } + + BaseTestCase.setRunContext(getRunType(), jarUrl); ExtractResource.removeOldMosipTestTestResource(); - if (checkRunType().equalsIgnoreCase("JAR")) { + if (getRunType().equalsIgnoreCase("JAR")) { ExtractResource.extractCommonResourceFromJar(); } else { ExtractResource.copyCommonResources(); } - ConfigManager.init(); - BaseTestCase.suiteSetup(); + InjiCertifyConfigManager.init(); + BaseTestCase.suiteSetup(getRunType()); SkipTestCaseHandler.loadTestcaseToBeSkippedList("testCaseSkippedList.txt"); setLogLevels(); @@ -98,7 +100,7 @@ public static void main(String[] arg) { LOGGER.error("Exception " + e.getMessage()); } - MockSMTPListener.bTerminate = true; + OTPListener.bTerminate = true; if (BaseTestCase.isTargetEnvLTS()) HealthChecker.bTerminate = true; @@ -129,7 +131,7 @@ public static void startTestRunner() { List modulesToRun = BaseTestCase.listOfModules; String os = System.getProperty("os.name"); LOGGER.info(os); - if (checkRunType().contains("IDE") || os.toLowerCase().contains("windows")) { + if (getRunType().contains("IDE") || os.toLowerCase().contains("windows")) { homeDir = new File(System.getProperty("user.dir") + "/testNgXmlFiles"); LOGGER.info("IDE :" + homeDir); } else { @@ -165,9 +167,9 @@ public static String getGlobalResourcePath() { } String path = null; - if (checkRunType().equalsIgnoreCase("JAR")) { + if (getRunType().equalsIgnoreCase("JAR")) { path = new File(jarUrl).getParentFile().getAbsolutePath() + "/MosipTestResource/MosipTemporaryTestResource"; - } else if (checkRunType().equalsIgnoreCase("IDE")) { + } else if (getRunType().equalsIgnoreCase("IDE")) { path = new File(MosipTestRunner.class.getClassLoader().getResource("").getPath()).getAbsolutePath() + "/MosipTestResource/MosipTemporaryTestResource"; if (path.contains(GlobalConstants.TESTCLASSES)) @@ -277,7 +279,7 @@ public static Properties getproperty(String path) { * * @return */ - public static String checkRunType() { + public static String getRunType() { if (MosipTestRunner.class.getResource("MosipTestRunner.class").getPath().contains(".jar")) return "JAR"; else diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java index 1cc46179..ff1fad7f 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/AddIdentity.java @@ -31,8 +31,8 @@ import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.ConfigManager; import io.mosip.testrig.apirig.utils.GlobalConstants; +import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager; import io.mosip.testrig.apirig.utils.InjiCertifyUtil; import io.mosip.testrig.apirig.utils.KernelAuthentication; import io.mosip.testrig.apirig.utils.OutputValidationUtil; @@ -56,7 +56,7 @@ public String getTestName() { @BeforeClass public static void setLogLevel() { - if (ConfigManager.IsDebugEnabled()) + if (InjiCertifyConfigManager.IsDebugEnabled()) logger.setLevel(Level.ALL); else logger.setLevel(Level.ERROR); diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java index 374d685f..95971f12 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java @@ -27,8 +27,8 @@ import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.ConfigManager; import io.mosip.testrig.apirig.utils.GlobalConstants; +import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager; import io.mosip.testrig.apirig.utils.InjiCertifyUtil; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -43,7 +43,7 @@ public class PostWithAutogenIdWithOtpGenerate extends AdminTestUtil implements I @BeforeClass public static void setLogLevel() { - if (ConfigManager.IsDebugEnabled()) + if (InjiCertifyConfigManager.IsDebugEnabled()) logger.setLevel(Level.ALL); else logger.setLevel(Level.ERROR); @@ -99,7 +99,7 @@ public void test(TestCaseDTO testCaseDTO) } if (BaseTestCase.isTargetEnvLTS()) { - if (ConfigManager.isInServiceNotDeployedList(GlobalConstants.RESIDENT) + if (InjiCertifyConfigManager.isInServiceNotDeployedList(GlobalConstants.RESIDENT) && (BaseTestCase.currentModule.equals("esignet") && testCaseName.startsWith("ESignetRes_Generate"))) { throw new SkipException("Generating VID using IdRepo API. Hence skipping this test case"); @@ -132,10 +132,10 @@ public void test(TestCaseDTO testCaseDTO) int currLoopCount = 0; while (currLoopCount < maxLoopCount) { if (testCaseName.contains(GlobalConstants.ESIGNET_)) { - if (ConfigManager.isInServiceNotDeployedList(GlobalConstants.ESIGNET)) { + if (InjiCertifyConfigManager.isInServiceNotDeployedList(GlobalConstants.ESIGNET)) { throw new SkipException("esignet is not deployed hence skipping the testcase"); } - String tempUrl = ConfigManager.getEsignetBaseUrl(); + String tempUrl = InjiCertifyConfigManager.getEsignetBaseUrl(); String endPointKeyWord = ""; if (sendOtpEndPoint.contains("BASEURL$")) { tempUrl = InjiCertifyUtil.getTempURL(testCaseDTO); @@ -204,10 +204,10 @@ public void test(TestCaseDTO testCaseDTO) reqJson = InjiCertifyUtil.smtpOtpHandler(reqJson, testCaseDTO); if (testCaseName.contains(GlobalConstants.ESIGNET_)) { - if (ConfigManager.isInServiceNotDeployedList(GlobalConstants.ESIGNET)) { + if (InjiCertifyConfigManager.isInServiceNotDeployedList(GlobalConstants.ESIGNET)) { throw new SkipException("esignet is not deployed hence skipping the testcase"); } - String tempUrl = ConfigManager.getEsignetBaseUrl(); + String tempUrl = InjiCertifyConfigManager.getEsignetBaseUrl(); String endPointKeyWord = ""; if (testCaseDTO.getEndPoint().contains("BASEURL$")) { tempUrl = InjiCertifyUtil.getTempURL(testCaseDTO); diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyAndQueryParamsForAutoGenId.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyAndQueryParamsForAutoGenId.java index 13386021..02df472c 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyAndQueryParamsForAutoGenId.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithBodyAndQueryParamsForAutoGenId.java @@ -1,11 +1,6 @@ package io.mosip.testrig.apirig.testscripts; -import java.io.IOException; import java.lang.reflect.Field; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableEntryException; -import java.security.cert.CertificateException; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -33,8 +28,8 @@ import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.ConfigManager; import io.mosip.testrig.apirig.utils.GlobalConstants; +import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager; import io.mosip.testrig.apirig.utils.InjiCertifyUtil; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.PartnerTypes; @@ -50,7 +45,7 @@ public class PostWithBodyAndQueryParamsForAutoGenId extends AdminTestUtil implem @BeforeClass public static void setLogLevel() { - if (ConfigManager.IsDebugEnabled()) + if (InjiCertifyConfigManager.IsDebugEnabled()) logger.setLevel(Level.ALL); else logger.setLevel(Level.ERROR); diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithOnlyPathParam.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithOnlyPathParam.java index 0c6048b6..d8d60aa9 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithOnlyPathParam.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithOnlyPathParam.java @@ -28,8 +28,8 @@ import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.ConfigManager; import io.mosip.testrig.apirig.utils.GlobalConstants; +import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager; import io.mosip.testrig.apirig.utils.InjiCertifyUtil; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -43,7 +43,7 @@ public class PostWithOnlyPathParam extends AdminTestUtil implements ITest { @BeforeClass public static void setLogLevel() { - if (ConfigManager.IsDebugEnabled()) + if (InjiCertifyConfigManager.IsDebugEnabled()) logger.setLevel(Level.ALL); else logger.setLevel(Level.ERROR); diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PutWithPathParamsAndBody.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PutWithPathParamsAndBody.java index fd92e842..bf943df8 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PutWithPathParamsAndBody.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PutWithPathParamsAndBody.java @@ -28,8 +28,8 @@ import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.ConfigManager; import io.mosip.testrig.apirig.utils.GlobalConstants; +import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager; import io.mosip.testrig.apirig.utils.InjiCertifyUtil; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -43,7 +43,7 @@ public class PutWithPathParamsAndBody extends AdminTestUtil implements ITest { @BeforeClass public static void setLogLevel() { - if (ConfigManager.IsDebugEnabled()) + if (InjiCertifyConfigManager.IsDebugEnabled()) logger.setLevel(Level.ALL); else logger.setLevel(Level.ERROR); @@ -119,7 +119,7 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad else { if (testCaseName.contains("ESignet_")) { - String tempUrl = ConfigManager.getEsignetBaseUrl(); + String tempUrl = InjiCertifyConfigManager.getEsignetBaseUrl(); response = putWithPathParamsBodyAndBearerToken(tempUrl + testCaseDTO.getEndPoint(), inputJson, COOKIENAME, testCaseDTO.getRole(), testCaseDTO.getTestCaseName(), pathParams); } else { diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java index cd49066d..7969e54c 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java @@ -28,8 +28,8 @@ import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.ConfigManager; import io.mosip.testrig.apirig.utils.GlobalConstants; +import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager; import io.mosip.testrig.apirig.utils.InjiCertifyUtil; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -44,7 +44,7 @@ public class SimplePost extends AdminTestUtil implements ITest { @BeforeClass public static void setLogLevel() { - if (ConfigManager.IsDebugEnabled()) + if (InjiCertifyConfigManager.IsDebugEnabled()) logger.setLevel(Level.ALL); else logger.setLevel(Level.ERROR); @@ -121,7 +121,7 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad } else { - String tempUrl = ConfigManager.getEsignetBaseUrl(); + String tempUrl = InjiCertifyConfigManager.getEsignetBaseUrl(); if (testCaseName.contains("ESignet_") || testCaseName.contains("InjiCertify")) { String endPointKeyWord = ""; diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java index c1e54dc9..e63d32a0 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenId.java @@ -29,8 +29,8 @@ import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.ConfigManager; import io.mosip.testrig.apirig.utils.GlobalConstants; +import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager; import io.mosip.testrig.apirig.utils.InjiCertifyUtil; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -46,7 +46,7 @@ public class SimplePostForAutoGenId extends AdminTestUtil implements ITest { @BeforeClass public static void setLogLevel() { - if (ConfigManager.IsDebugEnabled()) + if (InjiCertifyConfigManager.IsDebugEnabled()) logger.setLevel(Level.ALL); else logger.setLevel(Level.ERROR); @@ -101,7 +101,7 @@ public void test(TestCaseDTO testCaseDTO) } if (BaseTestCase.isTargetEnvLTS()) { - if (!ConfigManager.isInServiceNotDeployedList(GlobalConstants.RESIDENT)) { + if (!InjiCertifyConfigManager.isInServiceNotDeployedList(GlobalConstants.RESIDENT)) { if ((BaseTestCase.currentModule.equals("esignet") && testCaseName.startsWith("ESignetIdR_Generate"))) { throw new SkipException( GlobalConstants.VID_GENERATED_USING_RESIDENT_API_SO_FEATURE_NOT_SUPPORTED_OR_NEEDED_MESSAGE); @@ -143,10 +143,10 @@ public void test(TestCaseDTO testCaseDTO) } } else { if (testCaseName.contains("ESignet_")) { - if (ConfigManager.isInServiceNotDeployedList(GlobalConstants.ESIGNET)) { + if (InjiCertifyConfigManager.isInServiceNotDeployedList(GlobalConstants.ESIGNET)) { throw new SkipException("esignet is not deployed hence skipping the testcase"); } - String tempUrl = ConfigManager.getEsignetBaseUrl(); + String tempUrl = InjiCertifyConfigManager.getEsignetBaseUrl(); String endPointKeyWord = ""; if (testCaseDTO.getEndPoint().contains("BASEURL$")) { diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenIdForUrlEncoded.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenIdForUrlEncoded.java index 32098617..16864348 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenIdForUrlEncoded.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePostForAutoGenIdForUrlEncoded.java @@ -28,8 +28,8 @@ import io.mosip.testrig.apirig.utils.AdminTestException; import io.mosip.testrig.apirig.utils.AdminTestUtil; import io.mosip.testrig.apirig.utils.AuthenticationTestException; -import io.mosip.testrig.apirig.utils.ConfigManager; import io.mosip.testrig.apirig.utils.GlobalConstants; +import io.mosip.testrig.apirig.utils.InjiCertifyConfigManager; import io.mosip.testrig.apirig.utils.InjiCertifyUtil; import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.ReportUtil; @@ -43,7 +43,7 @@ public class SimplePostForAutoGenIdForUrlEncoded extends AdminTestUtil implement @BeforeClass public static void setLogLevel() { - if (ConfigManager.IsDebugEnabled()) + if (InjiCertifyConfigManager.IsDebugEnabled()) logger.setLevel(Level.ALL); else logger.setLevel(Level.ERROR); @@ -91,7 +91,7 @@ public void test(TestCaseDTO testCaseDTO) } if (testCaseDTO.getEndPoint().startsWith("$ESIGNETMOCKBASEURL$") && testCaseName.contains("SunBirdRC")) { - if (ConfigManager.isInServiceNotDeployedList("sunbirdrc")) + if (InjiCertifyConfigManager.isInServiceNotDeployedList("sunbirdrc")) throw new SkipException(GlobalConstants.SERVICE_NOT_DEPLOYED_MESSAGE); } @@ -102,7 +102,7 @@ public void test(TestCaseDTO testCaseDTO) } } - if (ConfigManager.isInServiceNotDeployedList(GlobalConstants.ESIGNET)) { + if (InjiCertifyConfigManager.isInServiceNotDeployedList(GlobalConstants.ESIGNET)) { throw new SkipException("esignet is not deployed hence skipping the testcase"); } testCaseName = isTestCaseValidForExecution(testCaseDTO); @@ -139,7 +139,7 @@ public void test(TestCaseDTO testCaseDTO) jsonInput = InjiCertifyUtil.reqJsonKeyWordHandeler(jsonInput, testCaseName); if (testCaseName.contains("ESignet_")) { - String tempUrl = ConfigManager.getEsignetBaseUrl(); + String tempUrl = InjiCertifyConfigManager.getEsignetBaseUrl(); String endPointKeyWord = ""; if (testCaseDTO.getEndPoint().contains("BASEURL$")) { diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/utils/InjiCertifyConfigManager.java b/apitest/src/main/java/io/mosip/testrig/apirig/utils/InjiCertifyConfigManager.java new file mode 100644 index 00000000..dfd5ef6f --- /dev/null +++ b/apitest/src/main/java/io/mosip/testrig/apirig/utils/InjiCertifyConfigManager.java @@ -0,0 +1,33 @@ +package io.mosip.testrig.apirig.utils; + +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +import org.apache.log4j.Logger; + +import io.mosip.testrig.apirig.testrunner.MosipTestRunner; + +public class InjiCertifyConfigManager extends ConfigManager{ + private static final Logger LOGGER = Logger.getLogger(InjiCertifyConfigManager.class); + + public static void init() { + Map moduleSpecificPropertiesMap = new HashMap<>(); + // Load scope specific properties + try { + String path = MosipTestRunner.getGlobalResourcePath() + "/config/injiCertify.properties"; + Properties props = getproperties(path); + // Convert Properties to Map and add to moduleSpecificPropertiesMap + for (String key : props.stringPropertyNames()) { + moduleSpecificPropertiesMap.put(key, props.getProperty(key)); + } + } catch (Exception e) { + LOGGER.error(e.getMessage()); + } + // Add module specific properties as well. + init(moduleSpecificPropertiesMap); + } + + + +} \ No newline at end of file diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/utils/InjiCertifyUtil.java b/apitest/src/main/java/io/mosip/testrig/apirig/utils/InjiCertifyUtil.java index 802aa501..82f0fac6 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/utils/InjiCertifyUtil.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/utils/InjiCertifyUtil.java @@ -7,8 +7,7 @@ import com.nimbusds.jose.jwk.RSAKey; import io.mosip.testrig.apirig.dto.TestCaseDTO; -import io.mosip.testrig.apirig.testrunner.BaseTestCase; -import io.mosip.testrig.apirig.testrunner.MockSMTPListener; +import io.mosip.testrig.apirig.testrunner.OTPListener; public class InjiCertifyUtil extends AdminTestUtil { @@ -27,7 +26,7 @@ public static String smtpOtpHandler(String inputJson, TestCaseDTO testCaseDTO) { if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE)) emailId = emailId.replace(GlobalConstants.OTP_AS_PHONE, ""); logger.info(emailId); - otp = MockSMTPListener.getOtp(emailId); + otp = OTPListener.getOtp(emailId); request.put("otp", otp); inputJson = request.toString(); return inputJson; @@ -41,7 +40,7 @@ public static String smtpOtpHandler(String inputJson, TestCaseDTO testCaseDTO) { if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE)) emailId = emailId.replace(GlobalConstants.OTP_AS_PHONE, ""); logger.info(emailId); - otp = MockSMTPListener.getOtp(emailId); + otp = OTPListener.getOtp(emailId); request.getJSONObject(GlobalConstants.REQUEST).put("otp", otp); inputJson = request.toString(); return inputJson; @@ -62,7 +61,7 @@ public static String smtpOtpHandler(String inputJson, TestCaseDTO testCaseDTO) { if (emailId.endsWith(GlobalConstants.OTP_AS_PHONE)) emailId = emailId.replace(GlobalConstants.OTP_AS_PHONE, ""); logger.info(emailId); - otp = MockSMTPListener.getOtp(emailId); + otp = OTPListener.getOtp(emailId); request.getJSONObject(GlobalConstants.REQUEST).getJSONArray(GlobalConstants.CHALLENGELIST) .getJSONObject(0).put(GlobalConstants.CHALLENGE, otp); inputJson = request.toString(); @@ -99,7 +98,7 @@ public static String reqJsonKeyWordHandeler(String jsonString, String testCaseNa accessToken = request.getString("idpAccessToken"); } jsonString = request.toString(); - tempUrl = getBaseURL(testCaseName, ConfigManager.getInjiCertifyBaseUrl()); + tempUrl = getBaseURL(testCaseName, InjiCertifyConfigManager.getInjiCertifyBaseUrl()); jsonString = replaceKeywordValue(jsonString, "$PROOF_JWT_3$", signJWKForMock(clientId, accessToken, oidcJWKKey4, testCaseName, tempUrl)); @@ -119,7 +118,7 @@ public static String reqJsonKeyWordHandeler(String jsonString, String testCaseNa if (request.has("client_id")) { clientId = request.get("client_id").toString(); } - String tempUrl = getBaseURL(testCaseName, ConfigManager.getInjiCertifyBaseUrl()); + String tempUrl = getBaseURL(testCaseName, InjiCertifyConfigManager.getInjiCertifyBaseUrl()); jsonString = replaceKeywordValue(jsonString, "$CLIENT_ASSERTION_JWT$", signJWKKey(clientId, oidcJWKKey1, tempUrl)); } @@ -138,7 +137,7 @@ public static String reqJsonKeyWordHandeler(String jsonString, String testCaseNa if (request.has("client_id")) { clientId = request.get("client_id").toString(); } - String tempUrl = getBaseURL(testCaseName, ConfigManager.getInjiCertifyBaseUrl()); + String tempUrl = getBaseURL(testCaseName, InjiCertifyConfigManager.getInjiCertifyBaseUrl()); jsonString = replaceKeywordValue(jsonString, "$CLIENT_ASSERTION_USER4_JWT$", signJWKKey(clientId, oidcJWKKey4, tempUrl)); @@ -186,10 +185,10 @@ public static String getTempURL(TestCaseDTO testCaseDTO, String endPoint) { String testCaseName = testCaseDTO.getTestCaseName(); if (testCaseDTO.getEndPoint().startsWith("$ESIGNETMOCKBASEURL$") && testCaseName.contains("SunBirdC")) { - if (ConfigManager.isInServiceNotDeployedList("sunbirdrc")) + if (InjiCertifyConfigManager.isInServiceNotDeployedList("sunbirdrc")) throw new SkipException(GlobalConstants.SERVICE_NOT_DEPLOYED_MESSAGE); - if (ConfigManager.getEsignetMockBaseURL() != null && !ConfigManager.getEsignetMockBaseURL().isBlank()) - return ApplnURI.replace("api-internal.", ConfigManager.getEsignetMockBaseURL()); + if (InjiCertifyConfigManager.getEsignetMockBaseURL() != null && !InjiCertifyConfigManager.getEsignetMockBaseURL().isBlank()) + return ApplnURI.replace("api-internal.", InjiCertifyConfigManager.getEsignetMockBaseURL()); } else if (testCaseDTO.getEndPoint().startsWith("$ESIGNETMOSIPIDBASEURL$")) { return ApplnURI.replace("api-internal", "esignet-mosipid"); } else if (testCaseDTO.getEndPoint().startsWith("$ESIGNETMOCKIDABASEURL$")) { diff --git a/apitest/src/main/resources/config/Kernel.properties b/apitest/src/main/resources/config/Kernel.properties deleted file mode 100644 index 39a47af6..00000000 --- a/apitest/src/main/resources/config/Kernel.properties +++ /dev/null @@ -1,284 +0,0 @@ -#---------------------------------- End point(s) relative URLs ----------------------------------# -authclientidsecretkeyURL = /v1/authmanager/authenticate/clientidsecretkey -authentication = /v1/authmanager/authenticate/useridPwd -authenticationInternal = /v1/authmanager/authenticate/internal/useridPwd -keycloakAuthURL = /auth/realms/master/protocol/openid-connect/token -auditLog_URI = /v1/auditmanager/audits -CentetMachineUserMappingToMasterData_uri = /v1/masterdata/registrationmachineusermappings -EmailNotification_URI = /v1/notifier/email/send -encrypt_URI = /v1/keymanager/encrypt -decrypt_URI = /v1/keymanager/decrypt -FetchApplication_URI = /v1/masterdata/applicationtypes -FetchApplication_lang_URI = /v1/masterdata/applicationtypes/{langcode} -FetchApplication_id_lang_URI = /v1/masterdata/applicationtypes/{code}/{langcode} -FetchBiometricAttribute_URI = /v1/masterdata/getbiometricattributesbyauthtype/{langcode}/{biometrictypecode} -FetchBiometricAuthType_URI = /v1/masterdata/biometrictypes/{langcode} -FetchBlackListedWord_URI = /v1/masterdata/blacklistedwords/{langcode} -FetchDevice_lang_URI = /v1/masterdata/devices/{languagecode} -FetchDevice_id_lang_URI = /v1/masterdata/devices/{languagecode}/{deviceType} -FetchDeviceSpec_lang_URI = /v1/masterdata/devicespecifications/{langcode} -FetchDeviceSpec_id_lang_URI = /v1/masterdata/devicespecifications/{langcode}/{devicetypecode} -FetchDocumentCategories_URI = /v1/masterdata/documentcategories/{langcode} -FetchDocumentCategories_URI_withcodeAndLangCode = /v1/masterdata/documentcategories/{code}/{langcode} -FetchDocumentTypes_URI = /v1/masterdata/documenttypes/{documentcategorycode}/{langcode} -FetchGenderType_URI = /v1/masterdata/gendertypes -FetchGenderType_id_lang_URI = /v1/masterdata/gendertypes/{langcode} -FetchHolidays_URI = /v1/masterdata/holidays -FetchHolidays_id_URI = /v1/masterdata/holidays/{holidayid} -FetchHolidays_id_lang_URI = /v1/masterdata/holidays/{holidayid}/{langcode} -FetchIDlist_URI = /v1/masterdata/idtypes/{langcode} -FetchLocationHierarchy_URI_withlangCode = /v1/masterdata/locations/{langcode} -FetchLocationHierarchy_URI_locationcode = /v1/masterdata/locations/{locationcode}/{langcode} -FetchLocationHierarchy_URI_hierarchyname = /v1/masterdata/locations/locationhierarchy/{hierarchyname} -FetchMachine_URI = /v1/masterdata/machines -FetchMachine_lang_URI = /v1/masterdata/machines/{langcode} -FetchMachine_id_lang_URI = /v1/masterdata/machines/{id}/{langcode} -FetchMachineHistory_URI = /v1/masterdata/machineshistories/{id}/{langcode}/{effdatetimes} -FetchRegCent_URI = /v1/masterdata/registrationcenters -FetchRegCent_id_lang_URI = /v1/masterdata/registrationcenters/{id}/{langcode} -FetchRegCent_loc_lang_URI = /v1/masterdata/getlocspecificregistrationcenters/{langcode}/{locationcode} -FetchRegCent_hir_name_lang_URI = /v1/masterdata/registrationcenters/{langcode}/{hierarchylevel}/{name} -FetchRegCent_prox_lang_URI = /v1/masterdata/getcoordinatespecificregistrationcenters/{langcode}/{longitude}/{latitude}/{proximitydistance} -FetchRegCentHistory_URI = /v1/masterdata/registrationcentershistory/{registrationCenterId}/{langcode}/{effectiveDate} -FetchRegCentHolidays_URI = /v1/masterdata/getregistrationcenterholidays/{langcode}/{registrationcenterid}/{year} -FetchRegcentMachUserMaping_URI = /v1/masterdata/getregistrationmachineusermappinghistory/{effdtimes}/{registrationcenterid}/{machineid}/{userid} -FetchRejectionReason_URI = /v1/masterdata/packetrejectionreasons/{reasoncategorycode}/{langcode} -FetchTemplate_URI = /v1/masterdata/templates -FetchTemplate_lang_URI = /v1/masterdata/templates/{langcode} -FetchTemplate_id_lang_URI = /v1/masterdata/templates/{langcode}/{templatetypecode} -FetchTitle_URI = /v1/masterdata/title/{langcode} -fetchAllTemplate = /v1/masterdata/templates/templatetypecodes/{code} -getApplicantType = /v1/masterdata/getApplicantType -fetchDeviceHistory = /v1/masterdata/deviceshistories/{id}/{langcode}/{effdatetimes} -getDocType_DocCatByAppID = /v1/masterdata/applicanttype/{applicantId}/languages -getDocTypeDocCatByLangCode = /v1/masterdata/validdocuments/{languagecode} -fetchImmediateChildLocation = /v1/masterdata/locations/immediatechildren/{locationcode}/{langcode} -getIndividualType = /v1/masterdata/individualtypes -getRoles = /v1/syncdata/roles -fetchRegCenter = /v1/masterdata/registrationcenters/validate/{id}/{langCode}/{timestamp} -fetchRegistrationCenterDeviceHistory = /v1/masterdata/registrationcenterdevicehistory/{regcenterid}/{deviceid}/{effdatetimes} -getusersBasedOnRegCenter = /v1/syncdata/userdetails/{regid} -licKeyGenerator = /v1/keymanager/license/generate -mapLicenseKey = /v1/keymanager/license/permission -fetchmapLicenseKey = /v1/keymanager/license/permission -OTPGeneration = /v1/otpmanager/otp/generate -OTPValidation = /v1/otpmanager/otp/validate -otpNotifier = /v1/otpnotifier/otp/send -RIDGenerator_URI = /v1/ridgenerator/generate/rid/{centerid}/{machineid} -SmsNotification_URI = /v1/notifier/sms/send -syncConf = /v1/syncdata/configs -fetchIncrementalData = /v1/syncjob/syncjobdef -fetchmasterdata = /v1/syncdata/masterdata -fetchmasterdatawithRID = /v1/syncdata/masterdata/{regcenterId} -SyncPublicKeyToRegClient_URI = /v1/keymanager/publickey/ -uingenerator = /v1/idgenerator/uin -validateGenderByName = /v1/masterdata/gendertypes/validate/{gendername} -validateLocationByName = /v1/masterdata/locations/validate/{locationname} -tokenIdGenerator_URI = /v1/keymanager/{uin}/{partnercode} -getRIDByUserId = /v1/authmanager/rid/{appid}/{userid} -syncMdatawithKeyIndex = /v1/syncdata/clientsettings -syncMdatawithRegCentIdKeyIndex = /v1/syncdata/clientsettings/{regcenterid} -uploadpublickey = /v1/syncdata/tpm/publickey -getUserHistory = /v1/masterdata/users/{id}/{eff_dtimes} -sendOtp = /v1/authmanager/authenticate/sendotp -useridOTP = /v1/authmanager/authenticate/useridOTP -preregSendOtp = /preregistration/v1/login/sendOtp/langcode -preregValidateOtp = /preregistration/v1/login/validateOtp -zoneMappingUrl = /v1/masterdata/zoneuser -zoneNameUrl = /v1/masterdata/zones/zonename -zoneMappingActivateUrl = /v1/masterdata/zoneuser -userCenterMappingUrl = /v1/masterdata/usercentermapping -bulkUploadUrl = /v1/admin/bulkupload -currentUserURI=/#/uinservices/viewhistory -actuatorEndpoint=/resident/v1/actuator/env -actuatorAdminEndpoint=/v1/admin/actuator/env -actuatorMasterDataEndpoint=/v1/masterdata/actuator/env -actuatorIDAEndpoint=/idauthentication/v1/actuator/env -actuatorRegprocEndpoint=/registrationprocessor/v1/registrationtransaction/actuator/env -actuatorEsignetEndpoint=/v1/esignet/actuator/env -tokenEndpoint=/v1/esignet/oauth/token -auditActuatorEndpoint=/v1/auditmanager/actuator/info -validateBindingEndpoint=ida-binding -esignetWellKnownEndPoint=/v1/esignet/oidc/.well-known/openid-configuration -signupSettingsEndPoint=/v1/signup/settings -actuatorMimotoEndpoint=/residentmobileapp/actuator/env -esignetActuatorPropertySection=esignet-default.properties -injiCertifyWellKnownEndPoint=/v1/certify/issuance/.well-known/openid-credential-issuer - - - -#---------------------------------- APP IDs ----------------------------------# -#-- When test rig ran in docker, these values dervied from the environment ---# -mosip_pms_app_id = partner -mosip_resident_app_id = resident -mosip_idrepo_app_id = idrepo -mosip_regclient_app_id = registrationclient -mosip_hotlist_app_id = hotlist -mosip_regprocclient_app_id = regproc -AuthAppID = resident -mosip_admin_app_id = admin - - - -#---------------------------------- Client IDs -------------------------------# -#-- When test rig ran in docker, these values dervied from the environment ---# -mosip_pms_client_id = mosip-pms-client -mosip_partner_client_id = mosip-partner-client -mosip_resident_client_id = mosip-resident-client -mosip_idrepo_client_id = mosip-idrepo-client -mosip_reg_client_id = mosip-reg-client -mosip_admin_client_id = mosip-admin-client -mosip_hotlist_client_id = mosip-hotlist-client -mosip_regproc_client_id = mosip-regproc-client -mpartner_default_mobile_client_id = mpartner-default-mobile -mosip_testrig_client_id = mosip-testrig-client -AuthClientID = mosip-resident-client - - - -#---------------------------------- Client Secret Keys -----------------------# -#-- When test rig ran in docker, these values dervied from the environment ---# -mosip_partner_client_secret = vXS7WUyPDpfWYuoz -mosip_pms_client_secret = 5Qj8vn989OL1Vlu6 -mosip_resident_client_secret = SnZQ6nnVwN9YWvdM -mosip_idrepo_client_secret = AeM2TwFuuZygCuvO -mosip_reg_client_secret = DLXygc82rkAkjrwV -mosip_admin_client_secret = Styop9nqkshXMTgj -mosip_hotlist_client_secret = TKyc4cqWymxjiLEsVydX4uME1xU3i9xl -mosip_regproc_client_secret = eyeXdyhO0u2ETibw -mpartner_default_mobile_secret = iCkj8BRZU6hP6MAN -mosip_testrig_client_secret = AonuXbikoWmHP5ug -AuthClientSecret = SnZQ6nnVwN9YWvdM - - - -#----------------------------- minio proprties ------------------------------# -s3-user-key = minioadmin -s3-user-secret = minioadmin -s3-host = http://minio.minio:9000 -s3-account = automation -s3-region = null -reportExpirationInDays = 3 -s3-account-for-persona-data = personaData -push-reports-to-s3 = yes - - -#-------------------- Keycloak User Creation proprties ----------------------# -#-- When test rig ran in docker,few of below dervied from the environment ---# -new_Resident_User = 111995 -new_Resident_Password = mosip123 -new_Resident_Role = default-roles-mosip,PARTNER_ADMIN -roles.111995 = PARTNER_ADMIN,default-roles-mosip -keycloak_UserName = admin -keycloak_Password = sMDr9Ainw9 -keycloak-external-url = https://iam.qa-inji.mosip.net -keycloak-realm-id = mosip -iam-users-to-create = 111997,111998,220005,111992,globaladmin,111887,111999 -iam-users-password = mosip123,mosip123,mosip123,mosip123,mosip123 -roles.220005 = GLOBAL_ADMIN,ID_AUTHENTICATION,REGISTRATION_ADMIN,REGISTRATION_SUPERVISOR,ZONAL_ADMIN -roles.111997 = AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR -roles.111999 = AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR -roles.111887 = AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,REGISTRATION_SUPERVISOR -roles.111998 = POLICYMANAGER -roles.111992 = GLOBAL_ADMIN -roles.globaladmin = GLOBAL_ADMIN,REGISTRATION_ADMIN,uma_authorization,ZONAL_ADMIN,default-roles-mosip - - -#------------------------- DB Connectivity proprties ------------------------# -#-- When test rig ran in docker,few of below dervied from the environment ---# -driver_class=org.postgresql.Driver -pool_size=1 -dialect=org.hibernate.dialect.PostgreSQLDialect -show_sql=true -current_session_context_class=thread -audit_url=jdbc:postgresql://qa-inji.mosip.net:5432/mosip_audit -audit_username=postgres -audit_password=2BhgiSpCaT -audit_default_schema=audit -DB_PORT= -installation-domain= -partner_url=jdbc:postgresql://qa-inji.mosip.net:5432/mosip_ida -partner_username=postgres -partner_password=2BhgiSpCaT -partner_default_schema=partner -reportLogPath=automationLogAndReport -postgresqlUser=postgresql -db-port=5432 -db-server=qa-inji.mosip.net -hibernate.connection.driver_class=org.postgresql.Driver -hibernate.connection.pool_size=1 -hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect -hibernate.show_sql=true -hibernate.current_session_context_class=thread -db-su-user=postgres -postgres-password=2BhgiSpCaT -pms_db_schema=pms -km_db_schema=keymgr -master_db_schema=master -audit_db_schema=audit -ida_db_schema=ida - - -#------------------------- DSL specific proprties ------------------------# -#------------------------- We need to see how to have DSL specific proprties file ------------------------# -packetUtilityBaseUrl=http://localhost:8080 -mountPathForScenario=D:/centralized/mountvolume -mountPath=/home/mosip/mountvolume -# Add scenarios to skip from automation and server side -# supported values "S-scnearioNumber" for server side and "A-scnearioNumber" for automation -scenariosToSkip= -# Add scenarios to include in the the execution list -# Empty if we want to execute all the scenarios--- -scenariosToExecute= -# supported values yes or no -useExternalScenarioSheet=yes -# supported values are 1 to 8 -threadCount=1 - -#------------------------ Generic properties ------------------------# -enableDebug=yes -preconfiguredOtp=111111 -usePreConfiguredOtp=true -# supported values yes or no. Assume that by Default e-signet is deployed -eSignetDeployed=yes -partnerUrlSuffix=oYf63Lax0DY2QkYMRHnrmDqhmO3RMWQagwm0ftgLlkuin1KOND/666/576732 -reportIgnoredTestCases=no -reportKnownIssueTestCases=no -servicesNotDeployed= -esignetMockBaseURL=esignet-insurance. -sunBirdBaseURL=registry -slack-webhook-url= -serverErrorsToMonitor=IDA-MLC-018 -pmsAuthInternal=true -partner_password=mosip123 -partner_userName=111997 -partner_revamp_userName=111999 -partner_user_password=mosip123 -policytest_password=mosip123 -policytest_userName=111998 -policytest_without_pmrole_userName=111887 -admin_password=mosip123 -admin_userName=220005 -admin_zone_password=mosip123 -admin_zone_userName=globaladmin -mockNotificationChannel=email,phone - - -#------------------------- Need to check if these are used or not ------------------------# -OTPTimeOut = 181 -attempt = 10 -ConfigParameters=mosip.kernel.rid.length,mosip.kernel.uin.length,mosip.kernel.sms.country.code,mosip.kernel.sms.number.length,mosip.kernel.otp.default-length,mosip.kernel.otp.expiry-time,mosip.kernel.otp.key-freeze-time,mosip.kernel.otp.validation-attempt-threshold,mosip.kernel.otp.min-key-length,mosip.kernel.otp.max-key-length,mosip.kernel.licensekey.length,mosip.supported-languages -# supported values are 0 ,1, 2 based on number of env languages -langselect=0 - - - -#----------------------------------AuthDemoService Host properties----------------------------------------------------------# -#authCertsPath= -authCertsPath=/home/mosip/authcerts - - - - -mosip_components_base_urls= -#auditmanager=api-internal.dev1.mosip.net;idrepository=api-internal.dev1.mosip.net;partnermanager=api-internal.qa-inji.mosip.net;idauthentication=api-internal.qa-inji.mosip.net;policymanager=api-internal.qa-inji.mosip.net \ No newline at end of file diff --git a/apitest/src/main/resources/config/injiCertify.properties b/apitest/src/main/resources/config/injiCertify.properties new file mode 100644 index 00000000..31c9196d --- /dev/null +++ b/apitest/src/main/resources/config/injiCertify.properties @@ -0,0 +1,15 @@ +#---------------------------------- End point(s) relative URLs ----------------------------------# +actuatorEndpoint=/resident/v1/actuator/env +actuatorAdminEndpoint=/v1/admin/actuator/env +actuatorMasterDataEndpoint=/v1/masterdata/actuator/env +actuatorIDAEndpoint=/idauthentication/v1/actuator/env +actuatorRegprocEndpoint=/registrationprocessor/v1/registrationtransaction/actuator/env +actuatorEsignetEndpoint=/v1/esignet/actuator/env +tokenEndpoint=/v1/esignet/oauth/token +auditActuatorEndpoint=/v1/auditmanager/actuator/info +validateBindingEndpoint=ida-binding +esignetWellKnownEndPoint=/v1/esignet/oidc/.well-known/openid-configuration +signupSettingsEndPoint=/v1/signup/settings +actuatorMimotoEndpoint=/residentmobileapp/actuator/env +esignetActuatorPropertySection=esignet-default.properties +injiCertifyWellKnownEndPoint=/v1/certify/issuance/.well-known/openid-credential-issuer \ No newline at end of file