Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-35404 | Move component specific test code from common to component api test rigs #918

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading