Skip to content
Open
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 @@ -41,6 +41,7 @@ public class DemoAuth extends IdAuthenticationUtil implements ITest {
protected String testCaseName = "";
public Response response = null;
public boolean isInternal = false;
public String idKeyName = null;

private EncryptionDecrptionUtil encryptDecryptUtil = new EncryptionDecrptionUtil();

Expand Down Expand Up @@ -68,6 +69,7 @@ public String getTestName() {
@DataProvider(name = "testcaselist")
public Object[] getTestCaseList(ITestContext context) {
String ymlFile = context.getCurrentXmlTest().getLocalParameters().get("ymlFile");
idKeyName = context.getCurrentXmlTest().getLocalParameters().get("idKeyName");
logger.info("Started executing yml: " + ymlFile);
return getYmlTestData(ymlFile);
}
Expand All @@ -78,13 +80,20 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
testCaseName = IdAuthenticationUtil.isTestCaseValidForExecution(testCaseDTO);

String partnerKeyUrl = PartnerRegistration.mispLicKey + "/" + PartnerRegistration.partnerId + "/" + PartnerRegistration.apiKey;
String partialPartnerKeyUrl = PartnerRegistration.mispLicKey + "/" + PartnerRegistration.partnerId;
String ekycPartnerKeyURL = PartnerRegistration.mispLicKey + "/" + PartnerRegistration.ekycPartnerId + "/" + PartnerRegistration.kycApiKey;

if(testCaseDTO.getEndPoint().contains("$partnerKeyURL$"))
{
testCaseDTO.setEndPoint(testCaseDTO.getEndPoint().replace("$partnerKeyURL$", partnerKeyUrl));
PartnerRegistration.appendEkycOrRp.set("rp-");
}
if (testCaseDTO.getEndPoint().contains("$partialPartnerKeyUrl$")) {
testCaseDTO.setEndPoint(testCaseDTO.getEndPoint().replace("$partialPartnerKeyUrl$", partialPartnerKeyUrl));
testCaseDTO.setEndPoint(replaceIdWithAutogeneratedId(testCaseDTO.getEndPoint(), "$ID:"));

PartnerRegistration.appendEkycOrRp.set("rp-");
}
if(testCaseDTO.getEndPoint().contains("$ekycPartnerKeyURL$"))
{
testCaseDTO.setEndPoint(testCaseDTO.getEndPoint().replace("$ekycPartnerKeyURL$", ekycPartnerKeyURL));
Expand Down Expand Up @@ -158,6 +167,10 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad

response = postRequestWithCookieAuthHeaderAndSignature(ApplnURI + testCaseDTO.getEndPoint(), authRequest, COOKIENAME, testCaseDTO.getRole(), testCaseDTO.getTestCaseName());

if (testCaseName.toLowerCase().contains("_sid")) {
writeAutoGeneratedId(response, idKeyName, testCaseName);
}

Map<String, List<OutputValidationDto>> ouputValid = OutputValidationUtil
.doJsonOutputValidation(response.asString(), getJsonFromTemplate(testCaseDTO.getOutput(), testCaseDTO.getOutputTemplate()));
Reporter.log(ReportUtil.getOutputValidationReport(ouputValid));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class OtpAuthNew extends IdAuthenticationUtil implements ITest {
protected String testCaseName = "";
public Response response = null;
public boolean isInternal = false;
public String idKeyName = null;

private EncryptionDecrptionUtil encryptDecryptUtil = new EncryptionDecrptionUtil();

Expand Down Expand Up @@ -66,6 +67,7 @@ public String getTestName() {
@DataProvider(name = "testcaselist")
public Object[] getTestCaseList(ITestContext context) {
String ymlFile = context.getCurrentXmlTest().getLocalParameters().get("ymlFile");
idKeyName = context.getCurrentXmlTest().getLocalParameters().get("idKeyName");
isInternal = Boolean.parseBoolean(context.getCurrentXmlTest().getLocalParameters().get("isInternal"));
logger.info("Started executing yml: " + ymlFile);
return getYmlTestData(ymlFile);
Expand All @@ -77,6 +79,7 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
testCaseName = IdAuthenticationUtil.isTestCaseValidForExecution(testCaseDTO);

String partnerKeyUrl = PartnerRegistration.mispLicKey + "/" + PartnerRegistration.partnerId + "/" + PartnerRegistration.apiKey;
String partialPartnerKeyUrl = PartnerRegistration.mispLicKey + "/" + PartnerRegistration.partnerId;
String ekycPartnerKeyURL = PartnerRegistration.mispLicKey + "/" + PartnerRegistration.ekycPartnerId + "/" + PartnerRegistration.kycApiKey;

if(testCaseDTO.getEndPoint().contains("$partnerKeyURL$"))
Expand All @@ -85,6 +88,12 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
testCaseDTO.setEndPoint(testCaseDTO.getEndPoint().replace("$partnerKeyURL$", partnerKeyUrl));
PartnerRegistration.appendEkycOrRp.set("rp-");
}
if (testCaseDTO.getEndPoint().contains("$partialPartnerKeyUrl$")) {
testCaseDTO.setEndPoint(testCaseDTO.getEndPoint().replace("$partialPartnerKeyUrl$", partialPartnerKeyUrl));
testCaseDTO.setEndPoint(replaceIdWithAutogeneratedId(testCaseDTO.getEndPoint(), "$ID:"));

PartnerRegistration.appendEkycOrRp.set("rp-");
}
if(testCaseDTO.getEndPoint().contains("$ekycPartnerKeyURL$"))
{
testCaseDTO.setEndPoint(testCaseDTO.getEndPoint().replace("$ekycPartnerKeyURL$", ekycPartnerKeyURL));
Expand Down Expand Up @@ -174,6 +183,10 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
logger.info("******Post request Json to EndPointUrl: " + ApplnURI + testCaseDTO.getEndPoint() + " *******");

response = postRequestWithCookieAuthHeaderAndSignature(ApplnURI + testCaseDTO.getEndPoint(), authRequest, COOKIENAME, testCaseDTO.getRole(), testCaseDTO.getTestCaseName());
logger.info("Response is = " + response.asString());
if (testCaseName.toLowerCase().contains("_sid")) {
writeAutoGeneratedId(response, idKeyName, testCaseName);
}

Map<String, List<OutputValidationDto>> ouputValid = OutputValidationUtil
.doJsonOutputValidation(response.asString(), getJsonFromTemplate(testCaseDTO.getOutput(), testCaseDTO.getOutputTemplate()));
Expand Down
86 changes: 73 additions & 13 deletions api-test/src/main/resources/ida/AddIdentity/AddIdentity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,7 @@ AddIdentity:

auth_AddIdentity_For_Kyc_Delegated_Bio_Auth_Smoke_Pos:
endPoint: /idrepository/v1/identity/
uniqueIdentifier: TC_DependentModule_Delegated_IdRepo_01
uniqueIdentifier: TC_DependentModule_IdRepo_Delegated_01
description: create UIN with valid parameters
role: idrepo
restMethod: post
Expand Down Expand Up @@ -1955,7 +1955,7 @@ AddIdentity:
}'
auth_AddIdentity_For_Kyc_Delegated_Bio_Auth_VID_smoke_Pos:
endPoint: /idrepository/v1/identity/
uniqueIdentifier: TC_DependentModule_Delegated_IdRepo_02
uniqueIdentifier: TC_DependentModule_IdRepo_Delegated_02
description: create UIN with valid parameters for delegated auth
role: idrepo
restMethod: post
Expand Down Expand Up @@ -1983,9 +1983,9 @@ AddIdentity:
output: '{
"status":"ACTIVATED"
}'
auth_AddIdentity_For_Kyc_Delegated_leftIris_Auth_UIN_Pos:
auth_AddIdentity_For_Kyc_Delegated_leftIris_Auth_UIN_smoke_Pos:
endPoint: /idrepository/v1/identity/
uniqueIdentifier: TC_DependentModule_Delegated_IdRepo_03
uniqueIdentifier: TC_DependentModule_IdRepo_Delegated_03
description: create UIN with valid parameters for delegated iris auth
role: idrepo
restMethod: post
Expand Down Expand Up @@ -2013,9 +2013,9 @@ AddIdentity:
output: '{
"status":"ACTIVATED"
}'
auth_AddIdentity_For_Kyc_Delegated_leftIris_Auth_VID_Pos:
auth_AddIdentity_For_Kyc_Delegated_leftIris_Auth_VID_smoke_Pos:
endPoint: /idrepository/v1/identity/
uniqueIdentifier: TC_DependentModule_Delegated_IdRepo_04
uniqueIdentifier: TC_DependentModule_IdRepo_Delegated_04
description: create UIN with valid parameters for delegated iris auth
role: idrepo
restMethod: post
Expand Down Expand Up @@ -2043,9 +2043,9 @@ AddIdentity:
output: '{
"status":"ACTIVATED"
}'
auth_AddIdentity_For_Kyc_Delegated_rightIris_Auth_UIN_Pos:
auth_AddIdentity_For_Kyc_Delegated_rightIris_Auth_UIN_smoke_Pos:
endPoint: /idrepository/v1/identity/
uniqueIdentifier: TC_DependentModule_Delegated_IdRepo_05
uniqueIdentifier: TC_DependentModule_IdRepo_Delegated_05
description: create UIN with valid parameters for delegated right iris auth
role: idrepo
restMethod: post
Expand Down Expand Up @@ -2075,7 +2075,7 @@ AddIdentity:
}'
auth_AddIdentity_For_Kyc_Delegated_rightIris_Auth_VID_smoke_Pos:
endPoint: /idrepository/v1/identity/
uniqueIdentifier: TC_DependentModule_Delegated_IdRepo_06
uniqueIdentifier: TC_DependentModule_IdRepo_Delegated_06
description: create UIN with valid parameters for delegated right iris auth
role: idrepo
restMethod: post
Expand Down Expand Up @@ -2103,9 +2103,9 @@ AddIdentity:
output: '{
"status":"ACTIVATED"
}'
auth_AddIdentity_withValidParameters_forDelegated_Infant_Pos:
auth_AddIdentity_withValidParameters_forDelegated_Infant_smoke_Pos:
endPoint: /idrepository/v1/identity/
uniqueIdentifier: TC_DependentModule_Delegated_IdRepo_07
uniqueIdentifier: TC_DependentModule_IdRepo_Delegated_07
description: create Infant UIN with valid parameters for delegate
role: idrepo
restMethod: post
Expand Down Expand Up @@ -2135,7 +2135,7 @@ AddIdentity:
}'
auth_AddIdentity_withValidParameters_forDelegated_differentIdType_Pos:
endPoint: /idrepository/v1/identity/
uniqueIdentifier: TC_DependentModule_Delegated_IdRepo_08
uniqueIdentifier: TC_DependentModule_IdRepo_Delegated_08
description: create UIN with valid parameters for delegate
role: idrepo
restMethod: post
Expand Down Expand Up @@ -2165,7 +2165,7 @@ AddIdentity:
}'
auth_AddIdentity_withValidParameters_forDemoDelegated_Pos:
endPoint: /idrepository/v1/identity/
uniqueIdentifier: TC_DependentModule_Delegated_IdRepo_09
uniqueIdentifier: TC_DependentModule_IdRepo_Delegated_09
description: create UIN with valid parameters for demo auth delegate
role: idrepo
restMethod: post
Expand All @@ -2192,4 +2192,64 @@ AddIdentity:
}'
output: '{
"status":"ACTIVATED"
}'
auth_AddIdentity_withValidParameters_forOtpDelegated_Pos:
endPoint: /idrepository/v1/identity/
uniqueIdentifier: TC_DependentModule_IdRepo_Delegated_10
description: create UIN with valid parameters for otp auth delegate
role: idrepo
restMethod: post
inputTemplate: ida/AddIdentity/addIdentity_$LANGNUMBER$
outputTemplate: ida/AddIdentity/addIdentityResult
input: '{
"value": "$BIOVALUE$",
"id": "mosip.id.create",
"registrationId": "$RID$",
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1990/09/28",
"postalCode": "14022",
"email": "auth_AddIdentity_withValidParameters_forOtpDelegated_smoke_Pos@mosip.net",
"phone": "7019858531",
"mobileno": "7019858531",
"referenceIdentityNumber": "6789545678878",
"version": "v1",
"introducerRID": "212124324784879",
"introducerUIN": "212124324784879",
"category": "individualBiometrics",
"requesttime": "$TIMESTAMP$"
}'
output: '{
"status":"ACTIVATED"
}'
auth_AddIdentity_withValidParameters_forLockedUIN_DemoDelegated_Pos:
endPoint: /idrepository/v1/identity/
uniqueIdentifier: TC_DependentModule_IdRepo_Delegated_11
description: create UIN with valid parameters for demo auth delegate
role: idrepo
restMethod: post
inputTemplate: ida/AddIdentity/addIdentity_$LANGNUMBER$
outputTemplate: ida/AddIdentity/addIdentityResult
input: '{
"value": "$BIOVALUE$",
"id": "mosip.id.create",
"registrationId": "$RID$",
"addressCopy": "Y",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1990/09/28",
"postalCode": "14022",
"email": "auth_AddIdentity_withValidParameters_forOtpDelegated_smoke_Pos@mosip.net",
"phone": "7019858531",
"mobileno": "7019858531",
"referenceIdentityNumber": "6789545678878",
"version": "v1",
"introducerRID": "212124324784879",
"introducerUIN": "212124324784879",
"category": "individualBiometrics",
"requesttime": "$TIMESTAMP$"
}'
output: '{
"status":"ACTIVATED"
}'
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,24 @@ AuthInternalLock:
}'
output: '{
"status": "Success"
}'

auth_AuthInternal_Permanent_Lock_DemoAuthDelegate_Valid_Smoke_Pos:
endPoint: /idrepository/v1/identity/authtypes/status
uniqueIdentifier: TC_IDA_AuthInternalLock_07
description: lock Demo authType Permanently for UIN
role: idrepo
restMethod: post
inputTemplate: ida/AuthInternalLock/authInternalLock
outputTemplate: ida/AuthInternalLock/authInternalLockResult
input: '{
"individualId": "$ID:AddIdentity_withValidParameters_forLockedUIN_DemoDelegated_Pos_UIN$",
"individualIdType": "UIN",
"authType": "Demo",
"authSubType": "",
"locked": true,
"unlockForSeconds": 0
}'
output: '{
"status": "Success"
}'
Loading