Skip to content

Commit

Permalink
Merge pull request #1066 from anup-nehe/develop
Browse files Browse the repository at this point in the history
resolve
  • Loading branch information
Sohandey authored Sep 25, 2023
2 parents cbba73f + 77d4e6b commit 27ef6ac
Show file tree
Hide file tree
Showing 14 changed files with 480 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public class AdminTestUtil extends BaseTestCase {
+ "config/healthCheckEndpoint.properties";
private static String serverComponentsCommitDetails;

String token = null;
String token = null;
String idToken = null;
String adminAutoGeneratedIdPropFileName = properties.getProperty("adminAutoGeneratedIdPropFileName");
String masterDataAutoGeneratedIdPropFileName = properties.getProperty("masterDataAutoGeneratedIdPropFileName");
Expand Down Expand Up @@ -2829,9 +2829,9 @@ public String inputJsonKeyWordHandeler(String jsonString, String testCaseName) {
jsonString = replaceKeywordWithValue(jsonString, "$LOCATIONCODE$", locationCode);

// Need to handle int replacement
// if (jsonString.contains("$HIERARCHYLEVEL$"))
// jsonString = replaceKeywordWithValue(jsonString, "$HIERARCHYLEVEL$",
// hierarchyLevel);
if (jsonString.contains("$HIERARCHYLEVEL$"))
jsonString = replaceKeywordWithValue(jsonString, "$HIERARCHYLEVEL$",
String.valueOf(hierarchyLevel));

if (jsonString.contains("$HIERARCHYNAME$"))
jsonString = replaceKeywordWithValue(jsonString, "$HIERARCHYNAME$", hierarchyName);
Expand Down Expand Up @@ -3476,16 +3476,30 @@ private String replaceIdWithAutogeneratedId(String jsonString, String idKey, Str
else
time += " AM";
jsonString = replaceKeywordWithValue(jsonString, keyToReplace, time);
} else
jsonString = replaceKeywordWithValue(jsonString, keyToReplace, props.getProperty(keyForIdProperty));
} else {
if(keyForIdProperty.equals("UploadPartnerCert_Misp_Valid_Smoke_sid_signedCertificateData")) {
String certData = props.getProperty(keyForIdProperty);
if (System.getProperty(GlobalConstants.OS_NAME).toLowerCase().contains(GlobalConstants.WINDOWS)) {
certData = certData.replaceAll("\n", "\\\\n");
} else {
certData = certData.replaceAll("\n", "\\\\n");

}
jsonString = replaceKeywordWithValue(jsonString, keyToReplace, certData);
}
else
jsonString = replaceKeywordWithValue(jsonString, keyToReplace, props.getProperty(keyForIdProperty));
}
if (jsonString.contains("\u200B")) {
jsonString = jsonString.replaceAll("\u200B", "");
}
if (jsonString.contains("\\p{Cf}")) {
jsonString = jsonString.replaceAll("\\p{Cf}", "");
}


jsonString = replaceIdWithAutogeneratedId(jsonString, idKey, autoGenIdFileName);

if (jsonString.contains("\u200B")) {
jsonString = jsonString.replaceAll("\u200B", "");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ public static void main(String[] arg) {
}

if (BaseTestCase.listOfModules.contains(GlobalConstants.MASTERDATA)) {

AdminTestUtil.getLocationLevelData();
AdminTestUtil.getLocationData();
BaseTestCase.mapUserToZone();
BaseTestCase.mapZone();
AdminTestUtil.getLocationLevelData();
AdminTestUtil.getLocationData();
AdminTestUtil.getZoneName();


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
HashMap<String, String> headers = new HashMap<>();
headers.put(SIGNATURE_HEADERNAME, signature);
String token = kernelAuthLib.getTokenByRole(testCaseDTO.getRole());

headers.put(COOKIENAME, token);

logger.info("******Post request Json to EndPointUrl: " + ApplnURI + testCaseDTO.getEndPoint() + " *******");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.mosip.testrig.apirig.testscripts;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -81,9 +82,18 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
logger.info("Not Getting"+GlobalConstants.POST_REQ_URL + testCaseDTO.getTestCaseName() + " *******");
}

Map<String, List<OutputValidationDto>> ouputValid = null;
if(testCaseName.contains("_StatusCode")) {

OutputValidationDto customResponse = customStatusCodeResponse(String.valueOf(response.getStatusCode()), testCaseDTO.getOutput());

ouputValid = new HashMap<>();
ouputValid.put("expected vs actual", List.of(customResponse));
}else {

Map<String, List<OutputValidationDto>> ouputValid = OutputValidationUtil
ouputValid = OutputValidationUtil
.doJsonOutputValidation(response.asString(), getJsonFromTemplate(testCaseDTO.getOutput(), testCaseDTO.getOutputTemplate()), testCaseDTO.isCheckErrorsOnlyInResponse());
}
Reporter.log(ReportUtil.getOutputValidationReport(ouputValid));

if (!OutputValidationUtil.publishOutputResult(ouputValid))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ KycBioAuth:
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/KycBioAuth/KycBioAuth
outputTemplate: esignet/KycBioAuth/KycBioAuthResult
outputTemplate: esignet/KycBioAuth/KycBioAuthResultKycStatus
input: '{
"bioSubType": "",
"bioType": "FACE",
Expand All @@ -27,13 +27,14 @@ KycBioAuth:
"kycAuthEndPoint": "/idauthentication/v1/kyc-auth/delegated/$ID:GenerateMispLK_All_Valid_Smoke_sid_licenseKey$​/$ID:PartnerSelfRegistration_Kyc_Valid_Smoke_sid_partnerId$​/$ID:CreateOIDCClient_Misp_Valid_Smoke_sid_clientId$"
}'
output: '{
"authStatus": true
"kycStatus": true
}'

Esignet_KycBioAuth_vid_all_Valid_Smoke:
endPoint: /v1/identity/createAuthRequest?id=$ID:Generate_Perpetual_VID_Kyc_Valid_Smoke_sid_vid$&idType=VID&isKyc=true&isInternal=false&transactionId=$TRANSACTIONID$&isNewInternalAuth=false&isPreLTS=false&signWithMisp=true&partnerName=$ID:PartnerSelfRegistration_Misp_Valid_Smoke_sid_partnerId$&keyFileNameByPartnerName=true​&Authtype=bio&moduleName=$MODULENAME$
role: resident
restMethod: post
checkErrorsOnlyInResponse: true
validityCheckRequired: true
inputTemplate: esignet/KycBioAuth/KycBioAuth
outputTemplate: esignet/KycBioAuth/KycBioAuthResult
Expand All @@ -58,7 +59,8 @@ KycBioAuth:
"kycAuthEndPoint": "/idauthentication/v1/kyc-auth/delegated/$ID:GenerateMispLK_All_Valid_Smoke_sid_licenseKey$​/$ID:PartnerSelfRegistration_Kyc_Valid_Smoke_sid_partnerId$​/$ID:CreateOIDCClient_Misp_Valid_Smoke_sid_clientId$"
}'
output: '{
"authStatus": true
"authStatus": "$IGNORE$",
"kycStatus": true
}'

Esignet_KycBioAuth_uin_Invalid_Biovalue_Neg:
Expand All @@ -67,7 +69,7 @@ KycBioAuth:
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/KycBioAuth/KycBioAuth
outputTemplate: esignet/KycBioAuth/KycBioAuthResult
outputTemplate: esignet/error
input: '{
"bioSubType": "",
"bioType": "FACE",
Expand All @@ -89,7 +91,11 @@ KycBioAuth:
"kycAuthEndPoint": "/idauthentication/v1/kyc-auth/delegated/$ID:GenerateMispLK_All_Valid_Smoke_sid_licenseKey$​/$ID:PartnerSelfRegistration_Kyc_Valid_Smoke_sid_partnerId$​/$ID:CreateOIDCClient_Misp_Valid_Smoke_sid_clientId$"
}'
output: '{
"authStatus": false
"errors": [
{
"errorCode": "IDA-BIA-001"
}
]
}'

Esignet_KycBioAuth_vid_Invalid_Biovalue_Neg:
Expand All @@ -98,7 +104,7 @@ KycBioAuth:
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/KycBioAuth/KycBioAuth
outputTemplate: esignet/KycBioAuth/KycBioAuthResult
outputTemplate: esignet/error
input: '{
"bioSubType": "",
"bioType": "FACE",
Expand All @@ -120,7 +126,11 @@ KycBioAuth:
"kycAuthEndPoint": "/idauthentication/v1/kyc-auth/delegated/$ID:GenerateMispLK_All_Valid_Smoke_sid_licenseKey$​/$ID:PartnerSelfRegistration_Kyc_Valid_Smoke_sid_partnerId$​/$ID:CreateOIDCClient_Misp_Valid_Smoke_sid_clientId$"
}'
output: '{
"authStatus": false
"errors": [
{
"errorCode": "IDA-BIA-001"
}
]
}'

Esignet_KycBioAuth_uin_RingFinger_all_Valid_Smoke:
Expand All @@ -129,7 +139,7 @@ KycBioAuth:
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/KycBioAuth/KycBioAuth
outputTemplate: esignet/KycBioAuth/KycBioAuthResult
outputTemplate: esignet/KycBioAuth/KycBioAuthResultKycStatus
input: '{
"bioSubType": "Left RingFinger",
"bioType": "Finger",
Expand All @@ -151,7 +161,7 @@ KycBioAuth:
"kycAuthEndPoint": "/idauthentication/v1/kyc-auth/delegated/$ID:GenerateMispLK_All_Valid_Smoke_sid_licenseKey$​/$ID:PartnerSelfRegistration_Kyc_Valid_Smoke_sid_partnerId$​/$ID:CreateOIDCClient_Misp_Valid_Smoke_sid_clientId$"
}'
output: '{
"authStatus": true
"kycStatus": true
}'

Esignet_KycBioAuth_vid_RingFinger_all_Valid_Smoke:
Expand All @@ -160,7 +170,7 @@ KycBioAuth:
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/KycBioAuth/KycBioAuth
outputTemplate: esignet/KycBioAuth/KycBioAuthResult
outputTemplate: esignet/KycBioAuth/KycBioAuthResultKycStatus
input: '{
"bioSubType": "Left RingFinger",
"bioType": "Finger",
Expand All @@ -182,7 +192,7 @@ KycBioAuth:
"kycAuthEndPoint": "/idauthentication/v1/kyc-auth/delegated/$ID:GenerateMispLK_All_Valid_Smoke_sid_licenseKey$​/$ID:PartnerSelfRegistration_Kyc_Valid_Smoke_sid_partnerId$​/$ID:CreateOIDCClient_Misp_Valid_Smoke_sid_clientId$"
}'
output: '{
"authStatus": true
"kycStatus": true
}'

Esignet_KycBioAuth_uin_RingFinger_Invalid_Biovalue_Neg:
Expand All @@ -191,7 +201,7 @@ KycBioAuth:
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/KycBioAuth/KycBioAuth
outputTemplate: esignet/KycBioAuth/KycBioAuthResult
outputTemplate: esignet/error
input: '{
"bioSubType": "Left RingFinger",
"bioType": "Finger",
Expand All @@ -213,7 +223,11 @@ KycBioAuth:
"kycAuthEndPoint": "/idauthentication/v1/kyc-auth/delegated/$ID:GenerateMispLK_All_Valid_Smoke_sid_licenseKey$​/$ID:PartnerSelfRegistration_Kyc_Valid_Smoke_sid_partnerId$​/$ID:CreateOIDCClient_Misp_Valid_Smoke_sid_clientId$"
}'
output: '{
"authStatus": false
"errors": [
{
"errorCode": "IDA-BIA-001"
}
]
}'

Esignet_KycBioAuth_vid_RingFinger_Invalid_Biovalue_Neg:
Expand All @@ -222,7 +236,7 @@ KycBioAuth:
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/KycBioAuth/KycBioAuth
outputTemplate: esignet/KycBioAuth/KycBioAuthResult
outputTemplate: esignet/error
input: '{
"bioSubType": "Left RingFinger",
"bioType": "Finger",
Expand All @@ -244,7 +258,11 @@ KycBioAuth:
"kycAuthEndPoint": "/idauthentication/v1/kyc-auth/delegated/$ID:GenerateMispLK_All_Valid_Smoke_sid_licenseKey$​/$ID:PartnerSelfRegistration_Kyc_Valid_Smoke_sid_partnerId$​/$ID:CreateOIDCClient_Misp_Valid_Smoke_sid_clientId$"
}'
output: '{
"authStatus": false
"errors": [
{
"errorCode": "IDA-BIA-001"
}
]
}'

Esignet_KycBioAuth_uin_LeftIris_all_Valid_Smoke:
Expand All @@ -253,7 +271,7 @@ KycBioAuth:
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/KycBioAuth/KycBioAuth
outputTemplate: esignet/KycBioAuth/KycBioAuthResult
outputTemplate: esignet/KycBioAuth/KycBioAuthResultKycStatus
input: '{
"bioSubType": "Left",
"bioType": "Iris",
Expand All @@ -275,7 +293,7 @@ KycBioAuth:
"kycAuthEndPoint": "/idauthentication/v1/kyc-auth/delegated/$ID:GenerateMispLK_All_Valid_Smoke_sid_licenseKey$​/$ID:PartnerSelfRegistration_Kyc_Valid_Smoke_sid_partnerId$​/$ID:CreateOIDCClient_Misp_Valid_Smoke_sid_clientId$"
}'
output: '{
"authStatus": true
"kycStatus": true
}'

Esignet_KycBioAuth_vid_LeftIris_all_Valid_Smoke:
Expand All @@ -284,7 +302,7 @@ KycBioAuth:
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/KycBioAuth/KycBioAuth
outputTemplate: esignet/KycBioAuth/KycBioAuthResult
outputTemplate: esignet/KycBioAuth/KycBioAuthResultKycStatus
input: '{
"bioSubType": "Left",
"bioType": "Iris",
Expand All @@ -306,7 +324,7 @@ KycBioAuth:
"kycAuthEndPoint": "/idauthentication/v1/kyc-auth/delegated/$ID:GenerateMispLK_All_Valid_Smoke_sid_licenseKey$​/$ID:PartnerSelfRegistration_Kyc_Valid_Smoke_sid_partnerId$​/$ID:CreateOIDCClient_Misp_Valid_Smoke_sid_clientId$"
}'
output: '{
"authStatus": true
"kycStatus": true
}'

Esignet_KycBioAuth_uin_LeftIris_Invalid_Biovalue_Neg:
Expand All @@ -315,7 +333,7 @@ KycBioAuth:
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/KycBioAuth/KycBioAuth
outputTemplate: esignet/KycBioAuth/KycBioAuthResult
outputTemplate: esignet/error
input: '{
"bioSubType": "Left",
"bioType": "Iris",
Expand All @@ -337,7 +355,11 @@ KycBioAuth:
"kycAuthEndPoint": "/idauthentication/v1/kyc-auth/delegated/$ID:GenerateMispLK_All_Valid_Smoke_sid_licenseKey$​/$ID:PartnerSelfRegistration_Kyc_Valid_Smoke_sid_partnerId$​/$ID:CreateOIDCClient_Misp_Valid_Smoke_sid_clientId$"
}'
output: '{
"authStatus": false
"errors": [
{
"errorCode": "IDA-BIA-001"
}
]
}'

Esignet_KycBioAuth_vid_LeftIris_Invalid_Biovalue_Neg:
Expand All @@ -346,7 +368,7 @@ KycBioAuth:
restMethod: post
validityCheckRequired: true
inputTemplate: esignet/KycBioAuth/KycBioAuth
outputTemplate: esignet/KycBioAuth/KycBioAuthResult
outputTemplate: esignet/error
input: '{
"bioSubType": "Left",
"bioType": "Iris",
Expand All @@ -368,5 +390,9 @@ KycBioAuth:
"kycAuthEndPoint": "/idauthentication/v1/kyc-auth/delegated/$ID:GenerateMispLK_All_Valid_Smoke_sid_licenseKey$​/$ID:PartnerSelfRegistration_Kyc_Valid_Smoke_sid_partnerId$​/$ID:CreateOIDCClient_Misp_Valid_Smoke_sid_clientId$"
}'
output: '{
"authStatus": false
"errors": [
{
"errorCode": "IDA-BIA-001"
}
]
}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"response": {
"kycStatus": {{kycStatus}}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
updatePartnerCertificate:
ESignet_updatePartnerCertificate_StatusCode_AuthDemoUrl_All_Valid_Smoke:
endPoint: /v1/identity/updatePartnerCertificate
role: partner
restMethod: post
inputTemplate: esignet/PmsIntegration/UpdatePartnerCertificate/updatePartnerCertificate
outputTemplate: esignet/PmsIntegration/UpdatePartnerCertificate/updatePartnerCertificateResult
input: '{
"certData": "$ID:UploadPartnerCert_Misp_Valid_Smoke_sid_signedCertificateData$",
"partnerType": "MISP",
"partnerName": "$ID:PartnerSelfRegistration_Misp_Valid_Smoke_sid_partnerId$",
"keyFileNameByPartnerName": "true",
"moduleName": "esignet"
}'
output: "200"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"certData": "{{certData}}",
"partnerType": "{{partnerType}}",
"partnerName": "{{partnerName}}",
"keyFileNameByPartnerName": "{{keyFileNameByPartnerName}}",
"moduleName": "{{moduleName}}"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ uploadPartnerCert:
"errors": "$IGNORE$"
}'

Esignet_UploadPartnerCert_Misp_Valid_Smoke:
Esignet_UploadPartnerCert_Misp_Valid_Smoke_sid:
endPoint: /v1/partnermanager/partners/certificate/upload
role: partner
checkErrorsOnlyInResponse: true
Expand Down
Loading

0 comments on commit 27ef6ac

Please sign in to comment.