From c70d267772469ccc5d6d634473e481b1b73b9bd4 Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Wed, 14 Aug 2024 14:36:39 +0530 Subject: [PATCH 1/2] INJIMOB-1592 Signed-off-by: Nandhukumar --- .../apirig/testrunner/MosipTestRunner.java | 3 - .../PostWithAutogenIdWithOtpGenerate.java | 14 +--- .../apirig/testscripts/SimplePost.java | 37 --------- .../testscripts/SimplePostForAutoGenId.java | 12 --- .../resources/mimoto/CreateVID/CreateVid.yml | 51 ++++++++++++ .../resources/mimoto/CreateVID/createVid.hbs | 11 +++ .../mimoto/CreateVID/createVidResult.hbs | 5 ++ .../mimoto/GetAllIssuers/GetAllIssuers.yml | 2 +- .../resources/mimoto/SendOTP1/SendOTP.yml | 81 ------------------- .../mimoto/SendOTP1/createSendOTP.hbs | 10 --- .../mimoto/SendOTP1/createSendOTP2.hbs | 10 --- .../SendOTP1/createSendOTPErrorResult.hbs | 14 ---- .../SendOTP1/createSendOTPErrorResult2.hbs | 14 ---- .../mimoto/SendOTP1/createSendOTPResult.hbs | 12 --- apitest/testNgXmlFiles/mimotoApi.xml | 29 +++---- 15 files changed, 85 insertions(+), 220 deletions(-) create mode 100644 apitest/src/main/resources/mimoto/CreateVID/CreateVid.yml create mode 100644 apitest/src/main/resources/mimoto/CreateVID/createVid.hbs create mode 100644 apitest/src/main/resources/mimoto/CreateVID/createVidResult.hbs delete mode 100644 apitest/src/main/resources/mimoto/SendOTP1/SendOTP.yml delete mode 100644 apitest/src/main/resources/mimoto/SendOTP1/createSendOTP.hbs delete mode 100644 apitest/src/main/resources/mimoto/SendOTP1/createSendOTP2.hbs delete mode 100644 apitest/src/main/resources/mimoto/SendOTP1/createSendOTPErrorResult.hbs delete mode 100644 apitest/src/main/resources/mimoto/SendOTP1/createSendOTPErrorResult2.hbs delete mode 100644 apitest/src/main/resources/mimoto/SendOTP1/createSendOTPResult.hbs 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 ebd83960..1be94abe 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 @@ -83,9 +83,6 @@ public static void main(String[] arg) { KeycloakUserManager.removeUser(); KeycloakUserManager.createUsers(); KeycloakUserManager.closeKeycloakInstance(); - - List localLanguageList = new ArrayList<>(BaseTestCase.getLanguageList()); - AdminTestUtil.getLocationData(); // Generate device certificates to be consumed by Mock-MDS PartnerRegistration.deleteCertificates(); diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java index 553f1801..29eab140 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/PostWithAutogenIdWithOtpGenerate.java @@ -96,19 +96,8 @@ public void test(TestCaseDTO testCaseDTO) } } testCaseName = isTestCaseValidForExecution(testCaseDTO); - - String inputJson = testCaseDTO.getInput().toString(); JSONObject req = new JSONObject(testCaseDTO.getInput()); - if (inputJson.contains("$PHONENUMBERFROMREGEXFORSIGNUP$")) { - String phoneNumber = getPhoneNumber(); - if (phoneNumber != null && !phoneNumber.isEmpty()) { - inputJson = replaceKeywordWithValue(inputJson, "$PHONENUMBERFROMREGEXFORSIGNUP$", phoneNumber); - req = new JSONObject(inputJson); - writeAutoGeneratedId(testCaseDTO.getTestCaseName(), "PHONE", phoneNumber); - } - } - auditLogCheck = testCaseDTO.isAuditLogCheck(); String otpRequest = null; String sendOtpReqTemplate = null; @@ -236,7 +225,8 @@ public void setResultTestName(ITestResult result) { @AfterClass(alwaysRun = true) public void waittime() { - if (!testCaseName.contains(GlobalConstants._AUTHENTICATEUSER)) { + if (!testCaseName.contains(GlobalConstants._AUTHENTICATEUSER) + && isOTPEnabled().equals("true")) { try { long delayTime = Long.parseLong(properties.getProperty("Delaytime")); if (!BaseTestCase.isTargetEnvLTS()) diff --git a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java index fd8b3c35..70b97512 100644 --- a/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java +++ b/apitest/src/main/java/io/mosip/testrig/apirig/testscripts/SimplePost.java @@ -98,43 +98,6 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad } String inputJson = getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()); - if (testCaseName.contains("CreateIdSchema")) { - inputJson = modifyIdSchemaInputJson(inputJson); - } - - if (inputJson.contains(""")) { - inputJson = inputJson.replace(""", "\""); - } - - if (inputJson.contains("$PHONENUMBERFROMREGEXFORSIGNUP$")) { - String phoneNumber = getPhoneNumber(); - if (phoneNumber != null && !phoneNumber.isEmpty()) { - inputJson = replaceKeywordWithValue(inputJson, "$PHONENUMBERFROMREGEXFORSIGNUP$", phoneNumber); - writeAutoGeneratedId(testCaseDTO.getTestCaseName(), "PHONE", phoneNumber); - } - } - - if (inputJson.contains("$FULLNAMETOREGISTERUSER$")) { - String jsonString = generateFullNameToRegisterUser(inputJson, testCaseDTO.getTestCaseName()); - if (!jsonString.isBlank()) - inputJson = jsonString; - } - - if (inputJson.contains("$PASSWORDTOREGISTERUSER$")) { -// String password = getPasswordPattern(); - String password = PASSWORD_FOR_ADDIDENTITY_AND_REGISTRATION; - if (password != null && !password.isEmpty()) { - inputJson = replaceKeywordWithValue(inputJson, "$PASSWORDTOREGISTERUSER$", password); -// writeAutoGeneratedId(testCaseDTO.getTestCaseName(), "PASSWORD", password); - } - } - - if (inputJson.contains("$PASSWORDTORESET$")) { - String passwordToReset = PASSWORD_TO_RESET; - if (passwordToReset != null && !passwordToReset.isEmpty()) { - inputJson = replaceKeywordWithValue(inputJson, "$PASSWORDTORESET$", passwordToReset); - } - } if (testCaseDTO.getTemplateFields() != null && templateFields.length > 0) { ArrayList inputtestCases = AdminTestUtil.getInputTestCase(testCaseDTO); 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 3519ecfb..b984eca2 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 @@ -98,18 +98,6 @@ public void test(TestCaseDTO testCaseDTO) } } - if (BaseTestCase.isTargetEnvLTS()) { - if (!ConfigManager.isInServiceNotDeployedList(GlobalConstants.RESIDENT)) { - if ((BaseTestCase.currentModule.equals("esignet") && testCaseName.startsWith("ESignetIdR_Generate"))) { - throw new SkipException( - GlobalConstants.VID_GENERATED_USING_RESIDENT_API_SO_FEATURE_NOT_SUPPORTED_OR_NEEDED_MESSAGE); -// qa115 - f -// cam - t f -// dev - t - } - } - } - testCaseName = isTestCaseValidForExecution(testCaseDTO); String[] templateFields = testCaseDTO.getTemplateFields(); String inputJson = ""; diff --git a/apitest/src/main/resources/mimoto/CreateVID/CreateVid.yml b/apitest/src/main/resources/mimoto/CreateVID/CreateVid.yml new file mode 100644 index 00000000..e1ab1921 --- /dev/null +++ b/apitest/src/main/resources/mimoto/CreateVID/CreateVid.yml @@ -0,0 +1,51 @@ +CreateVID: + Mimoto_Generate_Perpetual_VID_Valid_Smoke_sid: + endPoint: /idrepository/v1/vid + role: idrepo + restMethod: post + inputTemplate: mimoto/CreateVID/createVid + outputTemplate: mimoto/CreateVID/createVidResult + input: '{ + "vidType": "Perpetual", + "UIN": "$ID:AddIdentity_withValidParameters_smoke_Pos_UIN$", + "version": "v1", + "id": "mosip.vid.create", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "vidStatus":"ACTIVE" +}' + + Mimoto_Generate_Temporary_VID_Valid_Smoke_sid: + endPoint: /idrepository/v1/vid + role: idrepo + restMethod: post + inputTemplate: mimoto/CreateVID/createVid + outputTemplate: mimoto/CreateVID/createVidResult + input: '{ + "vidType": "Perpetual", + "UIN": "$ID:AddIdentity_withValidParameters_smoke_Pos_UIN$", + "version": "v1", + "id": "mosip.vid.create", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "vidStatus":"ACTIVE" +}' + + Mimoto_Generate_Perpetual_VID_Binding_Valid_Smoke_sid: + endPoint: /idrepository/v1/vid + role: idrepo + restMethod: post + inputTemplate: mimoto/CreateVID/createVid + outputTemplate: mimoto/CreateVID/createVidResult + input: '{ + "vidType": "Perpetual", + "UIN": "$ID:AddIdentity_Binding_smoke_Pos_UIN$", + "version": "v1", + "id": "mosip.vid.create", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "vidStatus":"ACTIVE" +}' \ No newline at end of file diff --git a/apitest/src/main/resources/mimoto/CreateVID/createVid.hbs b/apitest/src/main/resources/mimoto/CreateVID/createVid.hbs new file mode 100644 index 00000000..b0dfb2cb --- /dev/null +++ b/apitest/src/main/resources/mimoto/CreateVID/createVid.hbs @@ -0,0 +1,11 @@ + +{ + "id": "{{id}}", + "metadata": {}, + "request": { + "UIN": "{{UIN}}", + "vidType": "{{vidType}}" + }, + "requesttime": "{{requesttime}}", + "version": "{{version}}" +} \ No newline at end of file diff --git a/apitest/src/main/resources/mimoto/CreateVID/createVidResult.hbs b/apitest/src/main/resources/mimoto/CreateVID/createVidResult.hbs new file mode 100644 index 00000000..5e95428a --- /dev/null +++ b/apitest/src/main/resources/mimoto/CreateVID/createVidResult.hbs @@ -0,0 +1,5 @@ +{ + "response": { + "vidStatus": "{{vidStatus}}" + } +} \ No newline at end of file diff --git a/apitest/src/main/resources/mimoto/GetAllIssuers/GetAllIssuers.yml b/apitest/src/main/resources/mimoto/GetAllIssuers/GetAllIssuers.yml index 6c41a562..2f2d956b 100644 --- a/apitest/src/main/resources/mimoto/GetAllIssuers/GetAllIssuers.yml +++ b/apitest/src/main/resources/mimoto/GetAllIssuers/GetAllIssuers.yml @@ -12,7 +12,7 @@ GetAllIssuers: }' Mimoto_GetAllIssuers_Specific_Issuer_All_Valid_Smoke: - endPoint: /residentmobileapp/issuers/Mosip + endPoint: /mimoto/issuers/Mosip role: resident restMethod: get checkErrorsOnlyInResponse: true diff --git a/apitest/src/main/resources/mimoto/SendOTP1/SendOTP.yml b/apitest/src/main/resources/mimoto/SendOTP1/SendOTP.yml deleted file mode 100644 index 3edc30c0..00000000 --- a/apitest/src/main/resources/mimoto/SendOTP1/SendOTP.yml +++ /dev/null @@ -1,81 +0,0 @@ -SendOTP: - Mimoto_SendOTP_Valid_UIN_All_Smoke: - endPoint: /resident/v1/req/otp - role: resident - restMethod: post - checkErrorsOnlyInResponse: true - inputTemplate: mimoto/SendOTP1/createSendOTP - outputTemplate: mimoto/SendOTP1/createSendOTPResult - input: '{ - "transactionID": "$TRANSACTIONID$", - "requestTime": "$TIMESTAMP$", - "individualId": "$ID:AddIdentity_withValidParameters_smoke_Pos_UIN$", - "individualIdType": "UIN" -}' - output: '{ - "maskedMobile": "$IGNORE$", - "maskedEmail": "$IGNORE$" - }' - - Mimoto_SendOTP_Valid_VID_All_Smoke: - endPoint: /resident/v1/req/otp - role: resident - restMethod: post - checkErrorsOnlyInResponse: true - inputTemplate: mimoto/SendOTP1/createSendOTP - outputTemplate: mimoto/SendOTP1/createSendOTPResult - input: '{ - "transactionID": "$TRANSACTIONID$", - "requestTime": "$TIMESTAMP$", - "individualId": "$ID:Generate_Perpetual_VID_Valid_Smoke_sid_vid$", - "individualIdType": "VID" -}' - output: '{ - "maskedMobile": "$IGNORE$", - "maskedEmail": "$IGNORE$" -}' - - Mimoto_SendOTP_InValid_UIN_All: - endPoint: /v1/mimoto/req/otp - role: resident - restMethod: post - inputTemplate: mimoto/SendOTP1/createSendOTP - outputTemplate: mimoto/error - input: '{ - "transactionID": "$TRANSACTIONID$", - "requestTime": "$TIMESTAMP$", - "individualId": "4Y4B4 N@&&&&", - "individualIdType": "UIN" -}' - output: '{ - "errors": [ - { - "errorCode": "IDA-MLC-009", - "errorMessage": "$IGNORE$" - } - ] -}' - - Mimoto_SendOTP_Invalid_VID_Neg: - endPoint: /resident/v1/req/otp - role: resident - checkErrorsOnlyInResponse: true - restMethod: post - inputTemplate: mimoto/SendOTP1/createSendOTP - outputTemplate: mimoto/error - input: '{ - "transactionID": "$TRANSACTIONID$", - "requestTime": "$TIMESTAMP$", - "individualId": "$gyx56", - "individualIdType": "VID" -}' - output: '{ - "errors": [ - { - "errorCode": "IDA-MLC-009", - "errorMessage": "Invalid Input Parameter - individualId" - } - ], - "maskedMobile": "$IGNORE$", - "maskedEmail": "XXsXXeXXaXXoXXtXXn@gmail.com" -}' \ No newline at end of file diff --git a/apitest/src/main/resources/mimoto/SendOTP1/createSendOTP.hbs b/apitest/src/main/resources/mimoto/SendOTP1/createSendOTP.hbs deleted file mode 100644 index 34cba88f..00000000 --- a/apitest/src/main/resources/mimoto/SendOTP1/createSendOTP.hbs +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "mosip.identity.otp.internal", - "individualId": "{{individualId}}", - "individualIdType": "{{individualIdType}}", - "metadata": {}, - "otpChannel": ["PHONE","EMAIL"], - "requestTime": "{{requestTime}}", - "transactionID": "{{transactionID}}", - "version": "1.0" -} \ No newline at end of file diff --git a/apitest/src/main/resources/mimoto/SendOTP1/createSendOTP2.hbs b/apitest/src/main/resources/mimoto/SendOTP1/createSendOTP2.hbs deleted file mode 100644 index a0a1e4fc..00000000 --- a/apitest/src/main/resources/mimoto/SendOTP1/createSendOTP2.hbs +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "mosip.identity.otp.internal", - "individualId": "{{individualId}}", - "individualIdType": "{{individualIdType}}", - "metadata": {}, - "otpChannel": {{otpChannel}}, - "requestTime": "{{requestTime}}", - "transactionID": "{{transactionID}}", - "version": "1.0" -} \ No newline at end of file diff --git a/apitest/src/main/resources/mimoto/SendOTP1/createSendOTPErrorResult.hbs b/apitest/src/main/resources/mimoto/SendOTP1/createSendOTPErrorResult.hbs deleted file mode 100644 index c8368800..00000000 --- a/apitest/src/main/resources/mimoto/SendOTP1/createSendOTPErrorResult.hbs +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "$IGNORE$", - "version": "$IGNORE$", - "responseTime": "$IGNORE$", - "transactionID": "$IGNORE$", - "metadata": "$IGNORE$", - "response": "$IGNORE$", - "errors": [ - { - "errorCode": "{{errorCode}}", - "errorMessage": "{{errorMessage}}" - } - ] -} \ No newline at end of file diff --git a/apitest/src/main/resources/mimoto/SendOTP1/createSendOTPErrorResult2.hbs b/apitest/src/main/resources/mimoto/SendOTP1/createSendOTPErrorResult2.hbs deleted file mode 100644 index 1216fda8..00000000 --- a/apitest/src/main/resources/mimoto/SendOTP1/createSendOTPErrorResult2.hbs +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "$IGNORE$", - "version": "$IGNORE$", - "responseTime": "$IGNORE$", - "transactionID": "$IGNORE$", - "metadata": "$IGNORE$", - "response": "$IGNORE$", - "errors": [ - { - "errorCode": "{{errorCode}}", - "message": "{{message}}" - } - ] -} \ No newline at end of file diff --git a/apitest/src/main/resources/mimoto/SendOTP1/createSendOTPResult.hbs b/apitest/src/main/resources/mimoto/SendOTP1/createSendOTPResult.hbs deleted file mode 100644 index bd241fc2..00000000 --- a/apitest/src/main/resources/mimoto/SendOTP1/createSendOTPResult.hbs +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "mosip.identity.otp.internal", - "version": "1.0", - "responseTime": "$IGNORE$", - "transactionID": "$IGNORE$", - "metadata": "$IGNORE$", - "response": { - "maskedMobile": "{{maskedMobile}}", - "maskedEmail": "$IGNORE$" - }, - "errors": "$IGNORE$" -} \ No newline at end of file diff --git a/apitest/testNgXmlFiles/mimotoApi.xml b/apitest/testNgXmlFiles/mimotoApi.xml index e58afb2e..3237e5a1 100644 --- a/apitest/testNgXmlFiles/mimotoApi.xml +++ b/apitest/testNgXmlFiles/mimotoApi.xml @@ -8,21 +8,29 @@ - - + + + - - + + + + + + + + + + + - - - - - - - + From 90f550e989676633c430583c93910f6cf75facf5 Mon Sep 17 00:00:00 2001 From: Nandhukumar Date: Wed, 14 Aug 2024 18:06:53 +0530 Subject: [PATCH 2/2] MOSIP-35227 Signed-off-by: Nandhukumar --- apitest/src/main/resources/config/Kernel.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/apitest/src/main/resources/config/Kernel.properties b/apitest/src/main/resources/config/Kernel.properties index f90e39c5..34b12aae 100644 --- a/apitest/src/main/resources/config/Kernel.properties +++ b/apitest/src/main/resources/config/Kernel.properties @@ -102,6 +102,7 @@ validateBindingEndpoint=ida-binding esignetWellKnownEndPoint=/v1/esignet/oidc/.well-known/openid-configuration signupSettingsEndPoint=/v1/signup/settings actuatorMimotoEndpoint=/v1/mimoto/actuator/env +esignetActuatorPropertySection=esignet-default.properties