Skip to content

Commit

Permalink
MOSIP-35404 | Move component specific test code from common to compon…
Browse files Browse the repository at this point in the history
…ent api test rigs

Signed-off-by: Mohanachandran S <[email protected]>
  • Loading branch information
mohanachandran-s committed Oct 7, 2024
1 parent 6e914b0 commit 2b1be0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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()) {
Expand All @@ -84,58 +84,8 @@ public static void main(String[] arg) {
KeycloakUserManager.createUsers();
KeycloakUserManager.closeKeycloakInstance();

List<String> 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());
}
Expand Down
2 changes: 2 additions & 0 deletions api-test/src/main/resources/testCaseSkippedList.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
##### JIRA number;testcase
#MOSIP-12456------Mimoto_AddIdentity_Binding_smoke_Pos

0 comments on commit 2b1be0e

Please sign in to comment.