Skip to content

Commit

Permalink
Merge pull request #1357 from Sohandey/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ckm007 authored Nov 11, 2024
2 parents 7d67fa4 + 9c27793 commit 12423ce
Show file tree
Hide file tree
Showing 38 changed files with 656 additions and 275 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,33 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
identityRequest = jsonObject.toString();
}
}

identityRequest = inputJsonKeyWordHandeler(identityRequest, testCaseName);
identityRequest = JsonPrecondtion.parseAndReturnJsonContent(identityRequest, generateCurrentUTCTimeStamp(), "timestamp");
Map<String, String> demoAuthTempMap = encryptDecryptUtil.getEncryptSessionKeyValue(identityRequest);
String authRequest = getJsonFromTemplate(request.toString(), testCaseDTO.getInputTemplate());
logger.info("************* Modification of bio auth request ******************");
logger.info("************* Modification of demo auth request ******************");
Reporter.log("<b><u>Modification of demo auth request</u></b>");
authRequest = modifyRequest(authRequest, demoAuthTempMap, getResourcePath()+props.getProperty("idaMappingPath"));

authRequest = JsonPrecondtion.parseAndReturnJsonContent(authRequest, generateCurrentUTCTimeStamp(), "timestamp");
JSONObject authRequestTemp = new JSONObject(authRequest);

String originalRequestTime="";
if (authRequestTemp.has("requestTime") && !authRequestTemp.isNull("requestTime")) {
originalRequestTime = authRequestTemp.getString("requestTime");
}

authRequest = modifyRequest(authRequest, demoAuthTempMap, getResourcePath()+props.getProperty("idaMappingPath"));


authRequestTemp = new JSONObject(authRequest);
if (originalRequestTime != null) {
authRequestTemp.put("requestTime", originalRequestTime);
}
authRequestTemp.remove("env");
authRequestTemp.put("env", "Staging");
authRequest = authRequestTemp.toString();
testCaseDTO.setInput(authRequest);
testCaseDTO.setInput(authRequest);


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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad

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

if(testCaseName.contains("_expiredOTP")) {
try {
Thread.sleep(180000);
} catch (NumberFormatException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}

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

Map<String, List<OutputValidationDto>> ouputValid = OutputValidationUtil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,21 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
Map<String, String> bioAuthTempMap = (isInternal)
? encryptDecryptUtil.getInternalEncryptSessionKeyValue(otpIdentyEnryptRequest)
: encryptDecryptUtil.getEncryptSessionKeyValue(otpIdentyEnryptRequest);
// Get the authRequest from the template
String authRequest = getJsonFromTemplate(req.toString(), testCaseDTO.getInputTemplate());
logger.info("************* Modification of OTP auth request ******************");
Reporter.log("<b><u>Modification of otp auth request</u></b>");
// System.out.println("authRequest = " + authRequest);
authRequest = modifyRequest(authRequest, bioAuthTempMap, getResourcePath()+props.getProperty("idaMappingPath"));
// System.out.println("modifyRequest = " + authRequest);
testCaseDTO.setInput(authRequest);

JSONObject authRequestTemp = new JSONObject(authRequest);
String originalRequestTime = authRequestTemp.getString("requestTime");
authRequest = modifyRequest(authRequest, bioAuthTempMap, getResourcePath() + props.getProperty("idaMappingPath"));
authRequestTemp = new JSONObject(authRequest);
authRequestTemp.put("requestTime", originalRequestTime);
authRequestTemp.remove("env");
authRequestTemp.put("env", "Staging");
authRequest = authRequestTemp.toString();
testCaseDTO.setInput(authRequest);


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

Expand Down
29 changes: 29 additions & 0 deletions api-test/src/main/resources/ida/AddIdentity/AddIdentity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,35 @@ AddIdentity:
}'
output: '{
"status":"ACTIVATED"
}'
auth_AddIdentity_withValidParameters_used_for_vid_smoke_Pos:
endPoint: /idrepository/v1/identity/
description: create UIN with valid parameters
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": "1970/07/08",
"postalCode": "14022",
"email": "auth_AddIdentity_withValidParameters_used_for_vid_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_new_uin_smoke_Pos:
endPoint: /idrepository/v1/identity/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ AuthTransaction:
inputTemplate: ida/AuthTransaction/authTransaction
outputTemplate: ida/AuthTransaction/authTransactionError
input: '{
"individualId":"$ID:GenerateVID_All_Valid_Smoke_deactivate_Perpetual_sid_vid$"
"individualId":"$ID:AddIdentity_withValidParameters_used_for_vid_smoke_Pos_UIN$"
}'
output: '{
"errors": [
Expand All @@ -82,7 +82,7 @@ AuthTransaction:
inputTemplate: ida/AuthTransaction/authTransaction
outputTemplate: ida/AuthTransaction/authTransactionResult
input: '{
"individualId":"$ID:GenerateVID_All_Valid_Smoke_Temp_VID_sid_vid$"
"individualId":"$ID:GenerateVID_All_Valid_Smoke_Perpetual_sid_vid$"
}'
output: '{
"referenceIdType": "VID"
Expand Down
3 changes: 2 additions & 1 deletion api-test/src/main/resources/ida/BioAuth/BioAuth.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"requestSessionKey": "sessionkey",
"transactionID": "{{transactionId}}",
"domainUri": "baseurl",
"env": "Staging",
"env": "{{env}}",
"env": "Staging",
"keyIndex": "string",
"specVersion": "1.0",
"thumbprint": "partnerORinternalthumbprint",
Expand Down
Loading

0 comments on commit 12423ce

Please sign in to comment.