From 2b1be0e0a80a9ecddae15f5a01ca0e4bc66a9e0d Mon Sep 17 00:00:00 2001 From: Mohanachandran S Date: Mon, 7 Oct 2024 15:51:23 +0530 Subject: [PATCH] MOSIP-35404 | Move component specific test code from common to component api test rigs Signed-off-by: Mohanachandran S --- .../apirig/testrunner/MosipTestRunner.java | 60 ++----------------- .../main/resources/testCaseSkippedList.txt | 2 + 2 files changed, 7 insertions(+), 55 deletions(-) create mode 100644 api-test/src/main/resources/testCaseSkippedList.txt diff --git a/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java b/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java index 85362524c5..b46613a1a4 100644 --- a/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java +++ b/api-test/src/main/java/io/mosip/testrig/apirig/testrunner/MosipTestRunner.java @@ -21,9 +21,7 @@ import com.nimbusds.jose.jwk.KeyUse; import com.nimbusds.jose.jwk.RSAKey; -import io.mosip.testrig.apirig.dbaccess.DBManager; import io.mosip.testrig.apirig.utils.AdminTestUtil; -import io.mosip.testrig.apirig.utils.CertificateGenerationUtil; import io.mosip.testrig.apirig.utils.CertsUtil; import io.mosip.testrig.apirig.utils.GlobalConstants; import io.mosip.testrig.apirig.utils.JWKKeyUtil; @@ -33,6 +31,7 @@ import io.mosip.testrig.apirig.utils.OutputValidationUtil; import io.mosip.testrig.apirig.utils.PMSRevampConfigManger; import io.mosip.testrig.apirig.utils.PartnerRegistration; +import io.mosip.testrig.apirig.utils.SkipTestCaseHandler; /** * Class to initiate mosip api test execution @@ -68,10 +67,11 @@ public static void main(String[] arg) { } else { ExtractResource.copyCommonResources(); } + AdminTestUtil.init(); PMSRevampConfigManger.init(); BaseTestCase.suiteSetup(getRunType()); + SkipTestCaseHandler.loadTestcaseToBeSkippedList("testCaseSkippedList.txt"); setLogLevels(); - //AdminTestUtil.encryptDecryptUtil = new EncryptionDecrptionUtil(); // For now we are not doing health check for qa-115. if (BaseTestCase.isTargetEnvLTS()) { @@ -84,58 +84,8 @@ public static void main(String[] arg) { KeycloakUserManager.createUsers(); KeycloakUserManager.closeKeycloakInstance(); - List localLanguageList = new ArrayList<>(BaseTestCase.getLanguageList()); - AdminTestUtil.getLocationData(); - - String partnerKeyURL = ""; - String updatedPartnerKeyURL = ""; - String ekycPartnerKeyURL = ""; - - if (BaseTestCase.listOfModules.contains("auth") - || BaseTestCase.listOfModules.contains(GlobalConstants.ESIGNET)) { - PartnerRegistration.deleteCertificates(); - CertificateGenerationUtil.getThumbprints(); - AdminTestUtil.createAndPublishPolicy(); - AdminTestUtil.createEditAndPublishPolicy(); - partnerKeyURL = PartnerRegistration.generateAndGetPartnerKeyUrl(); - updatedPartnerKeyURL = PartnerRegistration.generateAndGetUpdatedPartnerKeyUrl(); - - AdminTestUtil.createAndPublishPolicyForKyc(); - ekycPartnerKeyURL = PartnerRegistration.generateAndGetEkycPartnerKeyUrl(); - - } - - if (BaseTestCase.listOfModules.contains(GlobalConstants.MASTERDATA)) { - AdminTestUtil.getHierarchyZoneCode(); - BaseTestCase.mapUserToZone(); - BaseTestCase.mapZone(); - AdminTestUtil.getLocationLevelData(); - AdminTestUtil.getLocationData(); - AdminTestUtil.getZoneName(); - - - - for (int i = 0; i < localLanguageList.size(); i++) { - BaseTestCase.languageList.clear(); - BaseTestCase.languageList.add(localLanguageList.get(i)); - - DBManager.clearMasterDbData(); - BaseTestCase.currentModule = GlobalConstants.MASTERDATA; - BaseTestCase.setReportName("masterdata-" + localLanguageList.get(i)); - startTestRunner(); - - } - - } else if (BaseTestCase.listOfModules.contains("auth") - || BaseTestCase.listOfModules.contains(GlobalConstants.ESIGNET)) { - if (partnerKeyURL.isEmpty()) - // if (partnerKeyURL.isEmpty() || ekycPartnerKeyURL.isEmpty()) - LOGGER.error("partnerKeyURL is null"); - else - startTestRunner(); - } else { - startTestRunner(); - } + startTestRunner(); + } catch (Exception e) { LOGGER.error("Exception " + e.getMessage()); } diff --git a/api-test/src/main/resources/testCaseSkippedList.txt b/api-test/src/main/resources/testCaseSkippedList.txt new file mode 100644 index 0000000000..76c50d7e34 --- /dev/null +++ b/api-test/src/main/resources/testCaseSkippedList.txt @@ -0,0 +1,2 @@ +##### JIRA number;testcase +#MOSIP-12456------Mimoto_AddIdentity_Binding_smoke_Pos \ No newline at end of file