From 0185980585d3b89fdabb55def84635d11279d1b6 Mon Sep 17 00:00:00 2001 From: Sohan Kumar Dey <72375959+Sohandey@users.noreply.github.com> Date: Wed, 15 May 2024 17:43:26 +0530 Subject: [PATCH] MOSIP-32982 Signed-off-by: Sohan Kumar Dey <72375959+Sohandey@users.noreply.github.com> --- .../apirig/testscripts/AuditValidator.java | 129 +++++++++++++++++ .../AddLostUinApplication.yml | 133 ++++++++++++++++++ .../resources/preReg/AuditLog/AuditLog.yml | 14 ++ .../preReg/AuditLog/AuditLogResult.hbs | 4 + .../resources/preReg/AuditLog/auditlog.hbs | 3 + .../DeleteLostUinApplication.yml | 46 ++++++ .../GetAllApplications/GetAllApplications.yml | 17 +++ .../GetAllApplicationsWithapplicationId.hbs | 3 + .../GetAllApplicationsWithapplicationId.yml | 13 ++ .../getAllApplicationsResult.hbs | 2 + .../GetAllPreRegApplications.yml | 22 +++ .../GetAvailableSlotForRegCentreId.yml | 12 ++ .../GetPRIDByDateRange/GetPRIDByDateRange.yml | 2 +- .../UpdatePreRegStatus/updatePreRegStatus.yml | 13 ++ .../bookAppointment/bookAppointment.yml | 26 +++- .../preReg/createPrereg/createPrereg.yml | 20 +++ .../preReg/uploadDocument/uploadDocument.yml | 118 ++++++++++++++++ apitest/testNgXmlFiles/preregApi.xml | 8 ++ 18 files changed, 583 insertions(+), 2 deletions(-) create mode 100644 apitest/src/main/java/io/mosip/testrig/apirig/testscripts/AuditValidator.java create mode 100644 apitest/src/main/resources/preReg/AuditLog/AuditLog.yml create mode 100644 apitest/src/main/resources/preReg/AuditLog/AuditLogResult.hbs create mode 100644 apitest/src/main/resources/preReg/AuditLog/auditlog.hbs create mode 100644 apitest/src/main/resources/preReg/GetAllApplicationsWithapplicationId/GetAllApplicationsWithapplicationId.hbs create mode 100644 apitest/src/main/resources/preReg/GetAllApplicationsWithapplicationId/GetAllApplicationsWithapplicationId.yml create mode 100644 apitest/src/main/resources/preReg/GetAllApplicationsWithapplicationId/getAllApplicationsResult.hbs diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/AuditValidator.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/AuditValidator.java new file mode 100644 index 00000000000..2325caf0937 --- /dev/null +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/AuditValidator.java @@ -0,0 +1,129 @@ +package io.mosip.testrig.apirig.testscripts; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.testng.ITest; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.Reporter; +import org.testng.SkipException; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import org.testng.internal.BaseTestMethod; +import org.testng.internal.TestResult; + +import io.mosip.testrig.apirig.dbaccess.AuditDBManager; +import io.mosip.testrig.apirig.dto.OutputValidationDto; +import io.mosip.testrig.apirig.dto.TestCaseDTO; +import io.mosip.testrig.apirig.testrunner.BaseTestCase; +import io.mosip.testrig.apirig.testrunner.HealthChecker; +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.OutputValidationUtil; +import io.restassured.response.Response; + +public class AuditValidator extends AdminTestUtil implements ITest { + private static final Logger logger = Logger.getLogger(AuditValidator.class); + protected String testCaseName = ""; + public static List templateFields = new ArrayList<>(); + public Response response = null; + /** + * get current testcaseName + */ + @Override + public String getTestName() { + return testCaseName; + } + + @BeforeClass + public static void setLogLevel() { + if (ConfigManager.IsDebugEnabled()) + logger.setLevel(Level.ALL); + else + logger.setLevel(Level.ERROR); + } + + /** + * Data provider class provides test case list + * + * @return object of data provider + */ + @DataProvider(name = "testcaselist") + public Object[] getTestCaseList(ITestContext context) { + String ymlFile = context.getCurrentXmlTest().getLocalParameters().get("ymlFile"); + logger.info("Started executing yml: " + ymlFile); + return getYmlTestData(ymlFile); + } + + + @Test(dataProvider = "testcaselist") + public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, AdminTestException { + testCaseName = testCaseDTO.getTestCaseName(); + if (HealthChecker.signalTerminateExecution) { + throw new SkipException(GlobalConstants.TARGET_ENV_HEALTH_CHECK_FAILED + HealthChecker.healthCheckFailureMapS); + } + String[] templateFields = testCaseDTO.getTemplateFields(); + List queryProp = Arrays.asList(templateFields); + logger.info(queryProp); + String query = "select * from audit.app_audit_log where cr_by = '"+BaseTestCase.currentModule +"-"+propsKernel.getProperty("partner_userName")+"'"; + + + logger.info(query); + Map response = AuditDBManager.executeQueryAndGetRecord(testCaseDTO.getRole(), query); + + + Map> objMap = new HashMap<>(); + List objList = new ArrayList<>(); + OutputValidationDto objOpDto = new OutputValidationDto(); + if(response.size()>0) { + + objOpDto.setStatus("PASS"); + } + else { + objOpDto.setStatus(GlobalConstants.FAIL_STRING); + } + + objList.add(objOpDto); + objMap.put(GlobalConstants.EXPECTED_VS_ACTUAL, objList); + + if (!OutputValidationUtil.publishOutputResult(objMap)) + throw new AdminTestException("Failed at output validation"); + } + + + /** + * The method ser current test name to result + * + * @param result + */ + @AfterMethod(alwaysRun = true) + public void setResultTestName(ITestResult result) { + + String deleteQuery = "delete from audit.app_audit_log where cr_by = '"+propsKernel.getProperty("partner_userName")+"'"; + logger.info(deleteQuery); + AuditDBManager.executeQueryAndDeleteRecord("audit", deleteQuery); + try { + Field method = TestResult.class.getDeclaredField("m_method"); + method.setAccessible(true); + method.set(result, result.getMethod().clone()); + BaseTestMethod baseTestMethod = (BaseTestMethod) result.getMethod(); + Field f = baseTestMethod.getClass().getSuperclass().getDeclaredField("m_methodName"); + f.setAccessible(true); + f.set(baseTestMethod, testCaseName); + } catch (Exception e) { + Reporter.log("Exception : " + e.getMessage()); + } + } +} diff --git a/apitest/src/main/resources/preReg/AddLostUinApplication/AddLostUinApplication.yml b/apitest/src/main/resources/preReg/AddLostUinApplication/AddLostUinApplication.yml index 36333ffd09b..9fe69c02a42 100644 --- a/apitest/src/main/resources/preReg/AddLostUinApplication/AddLostUinApplication.yml +++ b/apitest/src/main/resources/preReg/AddLostUinApplication/AddLostUinApplication.yml @@ -16,6 +16,120 @@ AddLostUinApplication: "bookingType": "LOST_FORGOTTEN_UIN", "applicationStatusCode": "SUBMITTED" }' + Prereg_AddLostUinApplication_Invalid_id: + endPoint: /preregistration/v1/applications/lostuin + role: batch + templateFields: ["langCode"] + restMethod: post + inputTemplate: preReg/AddLostUinApplication/addLostUinApplication + outputTemplate: preReg/error + input: '{ + "version": "1.0", + "requesttime": "$TIMESTAMP$", + "langCode": "eng", + "id": "n.create" +}' + output: '{ + "errors": [ + { + "errorCode": "PRG_CORE_REQ_014" + } + ] +}' + Prereg_AddLostUinApplication_invalid_lang_code: + endPoint: /preregistration/v1/applications/lostuin + role: batch + templateFields: ["langCode"] + restMethod: post + inputTemplate: preReg/AddLostUinApplication/addLostUinApplication + outputTemplate: preReg/error + input: '{ + "version": "1.0", + "requesttime": "$TIMESTAMP$", + "langCode": "e@@dd", + "id": "mosip.pre-registration.lostuin.create" +}' + output: '{ + "bookingType": "LOST_FORGOTTEN_UIN", + "applicationStatusCode": "SUBMITTED" +}' + Prereg_AddLostUinApplication_without_version: + endPoint: /preregistration/v1/applications/lostuin + role: batch + templateFields: ["langCode"] + restMethod: post + inputTemplate: preReg/AddLostUinApplication/addLostUinApplication + outputTemplate: preReg/error + input: '{ + "version": "", + "requesttime": "$TIMESTAMP$", + "langCode": "eng", + "id": "mosip.pre-registration.lostuin.create" +}' + output: '{ + "errors": [ + { + "errorCode": "PRG_CORE_REQ_014" + } + ] +}' + Prereg_AddLostUinApplication_without_version_attribute: + endPoint: /preregistration/v1/applications/lostuin + role: batch + templateFields: ["langCode"] + restMethod: post + inputTemplate: preReg/AddLostUinApplication/addLostUinApplication + outputTemplate: preReg/error + input: '{ + "version": "$IGNORE$", + "requesttime": "$TIMESTAMP$", + "langCode": "eng", + "id": "mosip.pre-registration.lostuin.create" +}' + output: '{ + "errors": [ + { + "errorCode": "PRG_CORE_REQ_014" + } + ] +}' + Prereg_AddLostUinApplication_with_INVALID_version: + endPoint: /preregistration/v1/applications/lostuin + role: batch + templateFields: ["langCode"] + restMethod: post + inputTemplate: preReg/AddLostUinApplication/addLostUinApplication + outputTemplate: preReg/error + input: '{ + "version": "$353F@GGWYS", + "requesttime": "$TIMESTAMP$", + "langCode": "eng", + "id": "mosip.pre-registration.lostuin.create" +}' + output: '{ + "errors": [ + { + "errorCode": "PRG_CORE_REQ_014" + } + ] +}' + Prereg_AddLostUinApplication_Valid_Smoke_sid: + endPoint: /preregistration/v1/applications/lostuin + role: batch + templateFields: ["langCode"] + restMethod: post + inputTemplate: preReg/AddLostUinApplication/addLostUinApplication + outputTemplate: preReg/AddLostUinApplication/addLostUinApplicationResult + input: '{ + "version": "1.0", + "requesttime": "$TIMESTAMP$", + "langCode": "eng", + "id": "mosip.pre-registration.lostuin.create" +}' + output: '{ + "bookingType": "LOST_FORGOTTEN_UIN", + "applicationStatusCode": "SUBMITTED" +}' Prereg_AddLostUinApplication_inValid_langcode: endPoint: /preregistration/v1/applications/lostuin @@ -35,4 +149,23 @@ AddLostUinApplication: "errorCode": "PRG_CORE_REQ_014" } ] +}' + Prereg_AddLostUinApplication_without_any_data: + endPoint: /preregistration/v1/applications/lostuin + role: batch + restMethod: post + inputTemplate: preReg/AddLostUinApplication/addLostUinApplication + outputTemplate: preReg/error + input: '{ + "version": "", + "requesttime": "", + "langCode": "", + "id": "" +}' + output: '{ + "errors": [ + { + "errorCode": "PRG_CORE_REQ_014" + } + ] }' \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/AuditLog/AuditLog.yml b/apitest/src/main/resources/preReg/AuditLog/AuditLog.yml new file mode 100644 index 00000000000..ea474cf74db --- /dev/null +++ b/apitest/src/main/resources/preReg/AuditLog/AuditLog.yml @@ -0,0 +1,14 @@ +addContact: + Prereg_AddContact_All_Valid_Smoke: + endPoint: SELECT module_name,cr_by FROM audit.app_audit_log where module_name LIKE '%partner%' order by action_dtimes desc LIMIT 5 + role: audit + templateFields: ["partnerQuery","partner service"] + restMethod: post + inputTemplate: partner/authPartner/AddContacts/addContact + outputTemplate: partner/authPartner/AddContacts/addContactResult + input: '{ + }' + output: '{ + "module_name": "partner service" + "cr_by": "111997" + }' \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/AuditLog/AuditLogResult.hbs b/apitest/src/main/resources/preReg/AuditLog/AuditLogResult.hbs new file mode 100644 index 00000000000..ecf91c4fc6c --- /dev/null +++ b/apitest/src/main/resources/preReg/AuditLog/AuditLogResult.hbs @@ -0,0 +1,4 @@ +{ + "module_name": "{{module_name}}", + "cr_by": "{{cr_by}}" +} \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/AuditLog/auditlog.hbs b/apitest/src/main/resources/preReg/AuditLog/auditlog.hbs new file mode 100644 index 00000000000..be4951065d3 --- /dev/null +++ b/apitest/src/main/resources/preReg/AuditLog/auditlog.hbs @@ -0,0 +1,3 @@ +{ + "moduleName": "{{moduleName}}" +} \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/DeleteLostUinApplication/DeleteLostUinApplication.yml b/apitest/src/main/resources/preReg/DeleteLostUinApplication/DeleteLostUinApplication.yml index 8814a1a8627..125a4b5093a 100644 --- a/apitest/src/main/resources/preReg/DeleteLostUinApplication/DeleteLostUinApplication.yml +++ b/apitest/src/main/resources/preReg/DeleteLostUinApplication/DeleteLostUinApplication.yml @@ -11,6 +11,36 @@ DeleteLostUinApplication: }' output: '{ "deletedBy": "$IGNORE$" +}' + Prereg_DeleteLostUinApplication_after_its_deletion: + endPoint: /preregistration/v1/applications/prereg/{applicationId} + role: batch + checkErrorsOnlyInResponse: true + restMethod: delete + inputTemplate: preReg/DeleteLostUinApplication/deleteLostUinApplication + outputTemplate: preReg/error + input: '{ + "applicationId": "$ID:CreatePrereg_Valid_Smoke_sid_preRegistrationId$" +}' + output: '{ + "errors": [ + { + "errorCode": "PRG_PAM_APP_005" + } + ] +}' + Prereg_DeleteLostUinApplication_multiple_application_sid: + endPoint: /preregistration/v1/applications/prereg/{applicationId} + role: batch + checkErrorsOnlyInResponse: true + restMethod: delete + inputTemplate: preReg/DeleteLostUinApplication/deleteLostUinApplication + outputTemplate: preReg/DeleteLostUinApplication/deleteLostUinApplicationResult + input: '{ + "applicationId": "$ID:CreatePrereg_All_Valid_Smoke_UpdateDocRefID_sid_preRegistrationId$" +}' + output: '{ + "deletedBy": "$IGNORE$" }' Prereg_DeleteLostUinApplication_inValid_preRegistrationId_sid: endPoint: /preregistration/v1/applications/prereg/{applicationId} @@ -27,4 +57,20 @@ DeleteLostUinApplication: "errorCode": "PRG_PAM_APP_005" } ] +}' + Prereg_DeleteLostUinApplication_random_number_sid: + endPoint: /preregistration/v1/applications/prereg/{applicationId} + role: batch + restMethod: delete + inputTemplate: preReg/DeleteLostUinApplication/deleteLostUinApplication + outputTemplate: preReg/error + input: '{ + "applicationId": "12736445738389" +}' + output: '{ + "errors": [ + { + "errorCode": "PRG_PAM_APP_005" + } + ] }' \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetAllApplications/GetAllApplications.yml b/apitest/src/main/resources/preReg/GetAllApplications/GetAllApplications.yml index f433644fc86..a2917f183f6 100644 --- a/apitest/src/main/resources/preReg/GetAllApplications/GetAllApplications.yml +++ b/apitest/src/main/resources/preReg/GetAllApplications/GetAllApplications.yml @@ -10,6 +10,23 @@ GetAllApplications: "type": null }' output: '{ +}' + Prereg_GetAllApplications_InValid: + endPoint: /preregistration/v1/applications + role: batch + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: preReg/GetAllApplications/getAllApplications + outputTemplate: preReg/error + input: '{ + "type": "263gedbdbegegedb" +}' + output: '{ + "errors": [ + { + "errorCode": "PRG_APP_016" + } + ] }' Prereg_GetAllApplications_InValid_Type: endPoint: /preregistration/v1/applications?type={type} diff --git a/apitest/src/main/resources/preReg/GetAllApplicationsWithapplicationId/GetAllApplicationsWithapplicationId.hbs b/apitest/src/main/resources/preReg/GetAllApplicationsWithapplicationId/GetAllApplicationsWithapplicationId.hbs new file mode 100644 index 00000000000..e783efaae56 --- /dev/null +++ b/apitest/src/main/resources/preReg/GetAllApplicationsWithapplicationId/GetAllApplicationsWithapplicationId.hbs @@ -0,0 +1,3 @@ +{ + "applicationId": "{{applicationId}}" +} \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetAllApplicationsWithapplicationId/GetAllApplicationsWithapplicationId.yml b/apitest/src/main/resources/preReg/GetAllApplicationsWithapplicationId/GetAllApplicationsWithapplicationId.yml new file mode 100644 index 00000000000..4fabba255e5 --- /dev/null +++ b/apitest/src/main/resources/preReg/GetAllApplicationsWithapplicationId/GetAllApplicationsWithapplicationId.yml @@ -0,0 +1,13 @@ +GetAllApplicationsWithapplicationId: + Prereg_GetAllApplicationsWithapplicationId_All_Valid_Smoke_sid: + endPoint: /preregistration/v1/applications/{applicationId} + role: batch + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: preReg/GetAllApplicationsWithapplicationId/GetAllApplicationsWithapplicationId + outputTemplate: preReg/GetAllApplicationsWithapplicationId/getAllApplicationsResult + input: '{ + "applicationId": "$ID:CreatePrereg_All_Valid_Smoke_sid_preRegistrationId$" +}' + output: '{ +}' \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetAllApplicationsWithapplicationId/getAllApplicationsResult.hbs b/apitest/src/main/resources/preReg/GetAllApplicationsWithapplicationId/getAllApplicationsResult.hbs new file mode 100644 index 00000000000..7a73a41bfdf --- /dev/null +++ b/apitest/src/main/resources/preReg/GetAllApplicationsWithapplicationId/getAllApplicationsResult.hbs @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetAllPreRegApplications/GetAllPreRegApplications.yml b/apitest/src/main/resources/preReg/GetAllPreRegApplications/GetAllPreRegApplications.yml index 59e716ddd5b..673ce6cadfb 100644 --- a/apitest/src/main/resources/preReg/GetAllPreRegApplications/GetAllPreRegApplications.yml +++ b/apitest/src/main/resources/preReg/GetAllPreRegApplications/GetAllPreRegApplications.yml @@ -9,4 +9,26 @@ GetAllPreRegApplications: input: '{}' output: '{ "bookingType": "NEW_PREREGISTRATION" +}' + Prereg_GetAllPreRegApplications_LOST_UIN_APPLICATION_sid: + endPoint: /preregistration/v1/applications + role: batch + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: preReg/GetAllPreRegApplications/getAllPreRegApplications + outputTemplate: preReg/GetAllPreRegApplications/GetAllPreRegApplicationsResult + input: '{}' + output: '{ + "bookingType": "NEW_PREREGISTRATION" +}' + Prereg_GetAllPreRegApplications_DELETE_UIN_APPLICATION_sid: + endPoint: /preregistration/v1/applications + role: batch + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: preReg/GetAllPreRegApplications/getAllPreRegApplications + outputTemplate: preReg/GetAllPreRegApplications/GetAllPreRegApplicationsResult + input: '{}' + output: '{ + "bookingType": "NEW_PREREGISTRATION" }' \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetAvailableSlotForRegCentreId/GetAvailableSlotForRegCentreId.yml b/apitest/src/main/resources/preReg/GetAvailableSlotForRegCentreId/GetAvailableSlotForRegCentreId.yml index 9405621a418..07ad9e5a2d6 100644 --- a/apitest/src/main/resources/preReg/GetAvailableSlotForRegCentreId/GetAvailableSlotForRegCentreId.yml +++ b/apitest/src/main/resources/preReg/GetAvailableSlotForRegCentreId/GetAvailableSlotForRegCentreId.yml @@ -26,4 +26,16 @@ GetAvailableSlotForRegCentreId: "errorCode": "KER-MSD-215" } ] +}' + Prereg_GetAvailableSlotForRegCentreId_Valid_Smoke_sid: + endPoint: /preregistration/v1/appointment/availability/{registrationCenterId} + role: batch + restMethod: get + inputTemplate: preReg/GetAvailableSlotForRegCentreId/getAvailableSlotForRegCentreId + outputTemplate: preReg/GetAvailableSlotForRegCentreId/getAvailableSlotForRegCentreIdResult + input: '{ + "registrationCenterId": "10003" +}' + output: '{ + "regCenterId": "10003" }' \ No newline at end of file diff --git a/apitest/src/main/resources/preReg/GetPRIDByDateRange/GetPRIDByDateRange.yml b/apitest/src/main/resources/preReg/GetPRIDByDateRange/GetPRIDByDateRange.yml index e0e56236373..9f5895f62d9 100644 --- a/apitest/src/main/resources/preReg/GetPRIDByDateRange/GetPRIDByDateRange.yml +++ b/apitest/src/main/resources/preReg/GetPRIDByDateRange/GetPRIDByDateRange.yml @@ -11,7 +11,7 @@ GetPRIDByDateRange: "requesttime": "$TIMESTAMP$", "registrationCenterId": "10003", "fromDate": "2020-05-09", - "toDate": "2021-10-11" + "toDate": "2030-10-11" }' output: '{ "id": "mosip.pre-registration.datasync.fetch.ids" diff --git a/apitest/src/main/resources/preReg/UpdatePreRegStatus/updatePreRegStatus.yml b/apitest/src/main/resources/preReg/UpdatePreRegStatus/updatePreRegStatus.yml index f51bb5f95cc..ef04ce3c4cc 100644 --- a/apitest/src/main/resources/preReg/UpdatePreRegStatus/updatePreRegStatus.yml +++ b/apitest/src/main/resources/preReg/UpdatePreRegStatus/updatePreRegStatus.yml @@ -11,6 +11,19 @@ UpdatePreRegStatus: "statusCode": "Pending_Appointment" }' output: '{ +}' + Prereg_UpdatePreRegStatus_for_expired_testcase_sid: + endPoint: /preregistration/v1/applications/prereg/status/{preRegistrationId}?statusCode={statusCode} + role: batch + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: preReg/UpdatePreRegStatus/updatePreRegStatus + outputTemplate: preReg/UpdatePreRegStatus/updatePreRegStatusResult + input: '{ + "preRegistrationId": "$ID:CreatePrereg_All_Valid_Smoke_for_expiry_sid_preRegistrationId$", + "statusCode": "Pending_Appointment" +}' + output: '{ }' Prereg_UpdatePreRegStatus_All_Valid_Smoke_BookByPRID_sid: endPoint: /preregistration/v1/applications/prereg/status/{preRegistrationId}?statusCode={statusCode} diff --git a/apitest/src/main/resources/preReg/bookAppointment/bookAppointment.yml b/apitest/src/main/resources/preReg/bookAppointment/bookAppointment.yml index 148c06b401e..e2007ba593d 100644 --- a/apitest/src/main/resources/preReg/bookAppointment/bookAppointment.yml +++ b/apitest/src/main/resources/preReg/bookAppointment/bookAppointment.yml @@ -619,5 +619,29 @@ BookAppointment: ] }' - + Prereg_BookAppointment_with_expired_status: + endPoint: /preregistration/v1/applications/appointment/{preRegistrationId} + role: batch + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: preReg/bookAppointment/bookAppointment + outputTemplate: preReg/error + input: '{ + "preRegistrationId":"$ID:CreatePrereg_All_Valid_Smoke_for_expiry_sid_preRegistrationId$", + "registration_center_id": "$registration_center_id$", + "id": "mosip.pre-registration.booking.book", + "version": "1.0", + "appointment_date": "2023-05-16", + "time_slot_from": "09:00:00", + "time_slot_to": "09:15:00", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "errors": [ + { + "errorCode": "PRG_CORE_REQ_013" + + } + ] +}' diff --git a/apitest/src/main/resources/preReg/createPrereg/createPrereg.yml b/apitest/src/main/resources/preReg/createPrereg/createPrereg.yml index 08b1ec32e32..5f2535cd072 100644 --- a/apitest/src/main/resources/preReg/createPrereg/createPrereg.yml +++ b/apitest/src/main/resources/preReg/createPrereg/createPrereg.yml @@ -165,6 +165,26 @@ CreatePrereg: "id": "mosip.pre-registration.demographic.create" }' output: '{ +}' + Prereg_CreatePrereg_All_Valid_Smoke_for_expiry_sid: + endPoint: /preregistration/v1/applications/prereg + role: batch + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: preReg/createPrereg/createPrereg + outputTemplate: preReg/createPrereg/createPreregResult + input: '{ + "postalCode": "14022", + "phone": "8249742850", + "email": "goku@technoforte.co.in", + "IDSchemaVersion": $SCHEMAVERSION$, + "dateOfBirth": "1996/01/01", + "version": "1.0", + "langCode": "$1STLANG$", + "requesttime": "$TIMESTAMP$", + "id": "mosip.pre-registration.demographic.create" +}' + output: '{ }' Prereg_CreatePrereg_in_Valid_id_sid: endPoint: /preregistration/v1/applications/prereg diff --git a/apitest/src/main/resources/preReg/uploadDocument/uploadDocument.yml b/apitest/src/main/resources/preReg/uploadDocument/uploadDocument.yml index 482a7046b6a..1cae0e3ea2b 100644 --- a/apitest/src/main/resources/preReg/uploadDocument/uploadDocument.yml +++ b/apitest/src/main/resources/preReg/uploadDocument/uploadDocument.yml @@ -21,6 +21,29 @@ UploadDocument: "docCatCode":"POA", "docTypCode":"RNC", "docFileFormat":"pdf" +}' + Prereg_UploadDocument_Rebook_the_booked_appoinment_Smoke_sid: + endPoint: /preregistration/v1/documents/{preRegistrationId} + role: batch + restMethod: post + inputTemplate: preReg/uploadDocument/uploadDocument + outputTemplate: preReg/uploadDocument/uploadDocumentResult + input: '{ + "id": "mosip.pre-registration.document.upload", + "docCatCode" : "POA", + "docTypCode" : "RNC", + "langCode" : "$1STLANG$", + "requesttime" : "$TIMESTAMP$", + "preRegistrationId": "$ID:CreatePrereg_All_Valid_Smoke_sid_preRegistrationId$", + "filePath": "preReg/uploadDocument/doc_POA.pdf", + "fileKeyName": "file" +}' + output: '{ +"id":"mosip.pre-registration.document.upload", +"docName":"doc_POA.pdf", +"docCatCode":"POA", +"docTypCode":"RNC", +"docFileFormat":"pdf" }' Prereg_UploadDocument_All_Valid_Smoke_POI_sid: endPoint: /preregistration/v1/documents/{preRegistrationId} @@ -876,4 +899,99 @@ UploadDocument: "message": "Request id is invalid" } ] +}' + + + + Prereg_UploadDocument_All_Valid_Smoke_expiry_sid: + endPoint: /preregistration/v1/documents/{preRegistrationId} + role: batch + restMethod: post + inputTemplate: preReg/uploadDocument/uploadDocument + outputTemplate: preReg/uploadDocument/uploadDocumentResult + input: '{ + "id": "mosip.pre-registration.document.upload", + "docCatCode" : "POA", + "docTypCode" : "RNC", + "langCode" : "$1STLANG$", + "requesttime" : "$TIMESTAMP$", + "preRegistrationId": "$ID:CreatePrereg_All_Valid_Smoke_for_expiry_sid_preRegistrationId$", + "filePath": "preReg/uploadDocument/doc_POA.pdf", + "fileKeyName": "file" +}' + output: '{ +"id":"mosip.pre-registration.document.upload", +"docName":"doc_POA.pdf", +"docCatCode":"POA", +"docTypCode":"RNC", +"docFileFormat":"pdf" +}' + Prereg_UploadDocument_All_Valid_Smoke_POI_expired_sid: + endPoint: /preregistration/v1/documents/{preRegistrationId} + role: batch + restMethod: post + inputTemplate: preReg/uploadDocument/uploadDocument + outputTemplate: preReg/uploadDocument/uploadDocumentResult + input: '{ + "id": "mosip.pre-registration.document.upload", + "docCatCode" : "POI", + "docTypCode" : "CIN", + "langCode" : "$1STLANG$", + "requesttime" : "$TIMESTAMP$", + "preRegistrationId": "$ID:CreatePrereg_All_Valid_Smoke_for_expiry_sid_preRegistrationId$", + "filePath": "preReg/uploadDocument/doc_POI.pdf", + "fileKeyName": "file" +}' + output: '{ +"id":"mosip.pre-registration.document.upload", +"docName":"doc_POI.pdf", +"docCatCode":"POI", +"docTypCode":"CIN", +"docFileFormat":"pdf" +}' + Prereg_UploadDocument_All_Valid_Smoke_POB_expired_sid: + endPoint: /preregistration/v1/documents/{preRegistrationId} + role: batch + restMethod: post + inputTemplate: preReg/uploadDocument/uploadDocument + outputTemplate: preReg/uploadDocument/uploadDocumentResult + input: '{ + "id": "mosip.pre-registration.document.upload", + "docCatCode" : "POB", + "docTypCode" : "COB", + "langCode" : "$1STLANG$", + "requesttime" : "$TIMESTAMP$", + "preRegistrationId": "$ID:CreatePrereg_All_Valid_Smoke_for_expiry_sid_preRegistrationId$", + "filePath": "preReg/uploadDocument/doc_POB.pdf", + "fileKeyName": "file" +}' + output: '{ +"id":"mosip.pre-registration.document.upload", +"docName":"doc_POB.pdf", +"docCatCode":"POB", +"docTypCode":"COB", +"docFileFormat":"pdf" +}' + Prereg_UploadDocument_All_Valid_Smoke_POR_expired_sid: + endPoint: /preregistration/v1/documents/{preRegistrationId} + role: batch + restMethod: post + inputTemplate: preReg/uploadDocument/uploadDocument + outputTemplate: preReg/uploadDocument/uploadDocumentResult + input: '{ + "id": "mosip.pre-registration.document.upload", + "docCatCode" : "POR", + "docTypCode" : "CRN", + "langCode" : "$1STLANG$", + "requesttime" : "$TIMESTAMP$", + "preRegistrationId": "$ID:CreatePrereg_All_Valid_Smoke_for_expiry_sid_preRegistrationId$", + "filePath": "preReg/uploadDocument/doc_POR.pdf", + "fileKeyName": "file" +}' + output: '{ +"id":"mosip.pre-registration.document.upload", +"docName":"doc_POR.pdf", +"docCatCode":"POR", +"docTypCode":"CRN", +"docFileFormat":"pdf" }' \ No newline at end of file diff --git a/apitest/testNgXmlFiles/preregApi.xml b/apitest/testNgXmlFiles/preregApi.xml index 1b7b0e87553..f8c8efa87b4 100644 --- a/apitest/testNgXmlFiles/preregApi.xml +++ b/apitest/testNgXmlFiles/preregApi.xml @@ -229,6 +229,14 @@ + + + + + + +