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 a3db19b6aa5..094918f4fce 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 @@ -104,37 +104,10 @@ public static void main(String[] arg) { BiometricDataProvider.generateBiometricTestData("Registration"); - 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 { + if (partnerKeyURL.isEmpty() || ekycPartnerKeyURL.isEmpty()) + LOGGER.error("partnerKeyURL is null"); + else startTestRunner(); - } } catch (Exception e) { LOGGER.error("Exception " + e.getMessage()); } 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 6703c5a74a9..fb76dcf1976 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 @@ -113,12 +113,10 @@ public void test(TestCaseDTO testCaseDTO) String[] templateFields = testCaseDTO.getTemplateFields(); String inputJson = ""; - if (!(BaseTestCase.certsForModule.equals("DSL-IDA") && (testCaseName.startsWith("Esignet_CreateOIDCClient")))) { + if (!(BaseTestCase.certsForModule.equals("DSL") && (testCaseName.startsWith("Esignet_CreateOIDCClient")))) { inputJson = getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()); } else { - { inputJson = testCaseDTO.getInput(); - } String outputJson = getJsonFromTemplate(testCaseDTO.getOutput(), testCaseDTO.getOutputTemplate()); @@ -145,21 +143,9 @@ public void test(TestCaseDTO testCaseDTO) throw new AdminTestException("Failed at output validation"); } } else { - - String tempUrl = ConfigManager.getEsignetBaseUrl(); - - if (testCaseName.contains("_AuthorizationCode_")) { - response = postRequestWithCookieAuthHeaderAndXsrfTokenForAutoGenId( - tempUrl + testCaseDTO.getEndPoint(), inputJson, COOKIENAME, testCaseDTO.getTestCaseName(), - idKeyName); - } else { - response = postWithBodyAndBearerTokenForAutoGeneratedId(tempUrl + testCaseDTO.getEndPoint(), - inputJson, COOKIENAME, testCaseDTO.getRole(), testCaseDTO.getTestCaseName(), idKeyName); - } - } { - response = postWithBodyAndCookieForAutoGeneratedId(ApplnURI + testCaseDTO.getEndPoint(), inputJson, - auditLogCheck, COOKIENAME, testCaseDTO.getRole(), testCaseDTO.getTestCaseName(), idKeyName); - } + response = postWithBodyAndCookieForAutoGeneratedId(ApplnURI + testCaseDTO.getEndPoint(), inputJson, + auditLogCheck, COOKIENAME, testCaseDTO.getRole(), testCaseDTO.getTestCaseName(), idKeyName); + } Map> ouputValid = null; @@ -171,7 +157,6 @@ public void test(TestCaseDTO testCaseDTO) if (!OutputValidationUtil.publishOutputResult(ouputValid)) throw new AdminTestException("Failed at output validation"); } - } /** diff --git a/apitest/src/main/resources/config/idaCertDataDeleteQueries.txt b/apitest/src/main/resources/config/idaCertDataDeleteQueries.txt new file mode 100644 index 00000000000..6070b05a02e --- /dev/null +++ b/apitest/src/main/resources/config/idaCertDataDeleteQueries.txt @@ -0,0 +1,8 @@ +##### DB queries to be executed to tear down the data used and generated during the test rig run + +delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=auth_pid%' +delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=auth_ekyc_pid%' +delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=auth_device_pid%' +delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=auth_ftm_pid%' +delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=partnernameforautomationesi%' +delete from ida.ca_cert_store WHERE cert_subject LIKE '%O=partnernameforesignet%' \ No newline at end of file diff --git a/apitest/src/main/resources/config/keyManagerCertDataDeleteQueries.txt b/apitest/src/main/resources/config/keyManagerCertDataDeleteQueries.txt new file mode 100644 index 00000000000..29303ca8536 --- /dev/null +++ b/apitest/src/main/resources/config/keyManagerCertDataDeleteQueries.txt @@ -0,0 +1,14 @@ +##### DB queries to be executed to tear down the data used and generated during the test rig run + +delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=auth_pid%' +delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=auth_ekyc_pid%' +delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=auth_device_pid%' +delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=auth_ftm_pid%' +delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=partnernameforautomationesi%' +delete from mosip_keymgr.keymgr.ca_cert_store WHERE cert_subject LIKE '%O=partnernameforesignet%' +delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=auth_pid%' +delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=auth_ekyc_pid%' +delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=auth_device_pid%' +delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=auth_ftm_pid%' +delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=partnernameforautomationesi%' +delete from mosip_keymgr.keymgr.partner_cert_store WHERE cert_subject LIKE '%O=partnernameforesignet%' \ No newline at end of file diff --git a/apitest/src/main/resources/config/masterDataCertDataDeleteQueries.txt b/apitest/src/main/resources/config/masterDataCertDataDeleteQueries.txt new file mode 100644 index 00000000000..48e277a29db --- /dev/null +++ b/apitest/src/main/resources/config/masterDataCertDataDeleteQueries.txt @@ -0,0 +1,8 @@ +##### DB queries to be executed to tear down the data used and generated during the test rig run + +delete from master.ca_cert_store WHERE cert_subject LIKE '%O=auth_pid%' +delete from master.ca_cert_store WHERE cert_subject LIKE '%O=auth_ekyc_pid%' +delete from master.ca_cert_store WHERE cert_subject LIKE '%O=auth_device_pid%' +delete from master.ca_cert_store WHERE cert_subject LIKE '%O=auth_ftm_pid%' +delete from master.ca_cert_store WHERE cert_subject LIKE '%O=partnernameforautomationesi%' +delete from master.ca_cert_store WHERE cert_subject LIKE '%O=partnernameforesignet%' \ No newline at end of file