Skip to content

Commit

Permalink
Merge pull request #954 from mohanachandran-s/develop
Browse files Browse the repository at this point in the history
MOSIP-34827 - Added test cases for L2 flow api's & MOSIP-36488 - Fixed bioAuth failure
  • Loading branch information
ckm007 authored Oct 16, 2024
2 parents e39dc02 + 40185c8 commit 1266a06
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,8 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad

JSONObject encryptedIdentityReqObject = new JSONObject(encryptedIdentityReq);

JSONObject objIdentityRequest = encryptedIdentityReqObject.getJSONObject(GlobalConstants.IDENTITYREQUEST);
logger.info(objIdentityRequest);
JSONArray arrayBiometrics = objIdentityRequest.getJSONArray(GlobalConstants.BIOMETRICS);
logger.info(encryptedIdentityReqObject);
JSONArray arrayBiometrics = encryptedIdentityReqObject.getJSONArray(GlobalConstants.BIOMETRICS);

String bioData = arrayBiometrics.toString();
logger.info(bioData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,15 @@ public void test(TestCaseDTO testCaseDTO) throws AuthenticationTestException, Ad
testCaseDTO.setEndPoint(testCaseDTO.getEndPoint().replace("$SUNBIRDBASEURL$", ""));
}

response = getWithPathParamAndCookie(tempUrl + testCaseDTO.getEndPoint(),
getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()), COOKIENAME,
testCaseDTO.getRole(), testCaseDTO.getTestCaseName());
if (testCaseName.contains("_AuthToken_Xsrf_")) {
response = getRequestWithCookieAuthHeaderAndXsrfToken(tempUrl + testCaseDTO.getEndPoint(),
getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()), COOKIENAME,
testCaseDTO.getRole(), testCaseDTO.getTestCaseName());
} else {
response = getWithPathParamAndCookie(tempUrl + testCaseDTO.getEndPoint(),
getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()), COOKIENAME,
testCaseDTO.getRole(), testCaseDTO.getTestCaseName());
}
} else {
response = getWithPathParamAndCookie(ApplnURI + testCaseDTO.getEndPoint(),
getJsonFromTemplate(testCaseDTO.getInput(), testCaseDTO.getInputTemplate()), auditLogCheck,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void test(TestCaseDTO testCaseDTO)
//tempUrl = ApplnURI.replace(GlobalConstants.API_INTERNAL, ConfigManager.getSunBirdBaseURL());
testCaseDTO.setEndPoint(testCaseDTO.getEndPoint().replace("$SUNBIRDBASEURL$", ""));
}
if (testCaseName.contains("_AuthorizationCode_")) {
if ((testCaseName.contains("_AuthorizationCode_")) || (testCaseName.contains("_AuthToken_Xsrf_"))) {
response = postRequestWithCookieAuthHeaderAndXsrfTokenForAutoGenId(
tempUrl + testCaseDTO.getEndPoint(), inputJson, COOKIENAME, testCaseDTO.getTestCaseName(),
idKeyName);
Expand Down
27 changes: 27 additions & 0 deletions api-test/src/main/resources/esignet/AddIdentity/AddIdentity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -613,4 +613,31 @@ AddIdentity:
}'
output: '{
"status":"ACTIVATED"
}'

ESignet_AddIdentity_L2_Valid_Parameters_smoke_Pos:
endPoint: /idrepository/v1/identity/
role: idrepo
restMethod: post
inputTemplate: esignet/AddIdentity/addIdentity_$LANGNUMBER$
outputTemplate: esignet/AddIdentity/addIdentityResult
input: '{
"value": "$BIOVALUE$",
"id": "mosip.id.create",
"registrationId": "$RID$",
"biometricReferenceId": "23452353",
"UIN": "$UIN$",
"dateOfBirth": "1992/04/15",
"postalCode": "14022",
"email": "[email protected]",
"phone": "9876543210",
"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
@@ -1,5 +1,4 @@
{
"identityRequest": {
"biometrics": [
{
"data": {
Expand Down Expand Up @@ -35,5 +34,4 @@
],
"timestamp": "$DATETIME$",
"transactionID": "{{transactionId}}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,28 @@ OAuthDetailsRequestV3:
}'
output: '{
}'

ESignet_OAuthDetailsRequest_V3_WithClaimValues_AuthToken_Xsrf_uin_all_Valid_Smoke_sid:
endPoint: /v1/esignet/authorization/v3/oauth-details
role: resident
restMethod: post
checkErrorsOnlyInResponse: true
inputTemplate: esignet/OAuthDetailsRequestV3/OAuthDetailsWithClaimValueRequest
input: '{
"requestTime": "$TIMESTAMP$",
"clientId": "0brnxh_duaXqCa-HW4kSeljeMp0qGOmqh4tm_zFKVgY",
"scope": "openid profile",
"responseType": "code",
"redirectUri": "$IDPREDIRECTURI$",
"display": "popup",
"prompt": "login",
"acrValues": "mosip:idp:acr:generated-code",
"nonce": "973eieljzng",
"state": "urlInfo1724138417665",
"claimsLocales": "en",
"uiLocales": "en-US"
}'
output: '{
}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"requestTime": "{{requestTime}}",
"request": {
"clientId": "{{clientId}}",
"scope": "{{scope}}",
"responseType": "{{responseType}}",
"redirectUri": "{{redirectUri}}",
"display": "{{display}}",
"prompt": "{{prompt}}",
"acrValues": "{{acrValues}}",
"claims": {
"userinfo": {
"name": {
"essential": false
},
"phone_number": {
"essential": true
},
"verified_claims": [
{
"verification": {
"trust_framework": {
"value": ["de_aml", "jp_aml"]
},
"assurance-level": {
"value": "high"
},
"time": {
"max_age": 63113852
},
"evidence": [
{"type": { "value": "document" }},
{"method": { "value": "test" }}
]
},
"claims": {
"given_name": {
"value":["automation", "test"],
"purpose":"Name given by user",
"essential": true
},
"name": {
"value": "automation",
"values":["ab","cd"]
},
"phone_number": {
"value": "1234567890"
},
"email": {
"essential": true
}
}
}
]
},
"id_token": {}
},
"nonce" : "{{nonce}}",
"state" : "{{state}}",
"claimsLocales" : "{{claimsLocales}}",
"uiLocales" : "{{uiLocales}}"
}
}
8 changes: 4 additions & 4 deletions api-test/testNgXmlFiles/esignetSuite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@
</test> -->

<!-- Start of Sign up L2 phase test cases -->
<!-- <test name="OAuthDetailsRequestV3">
<test name="OAuthDetailsRequestV3">
<parameter name="ymlFile"
value="esignet/OAuthDetailsRequestV3/OAuthDetailsRequest.yml" />
<parameter name="idKeyName" value="transactionId,encodedResp" />
Expand Down Expand Up @@ -1083,13 +1083,13 @@
<class name="io.mosip.testrig.apirig.testscripts.SimplePost" />
</classes>
</test>
<test name="PrepareSignupRedirectNeg">
<test name="PrepareSignupRedirectNeg">
<parameter name="ymlFile"
value="esignet/PrepareSignupRedirectNeg/PrepareSignupRedirectNeg.yml" />
<parameter name="idKeyName" value="idToken" />
<classes>
<class name="io.mosip.testrig.apirig.testscripts.SimplePostForAutoGenId" />
</classes>
</test>-->
</test>
<!-- End of Sign up L2 phase test cases -->
</suite>
</suite>

0 comments on commit 1266a06

Please sign in to comment.