MOSIP-44864: Automated ESIGNET Testcases For OIDC Client.#1703
MOSIP-44864: Automated ESIGNET Testcases For OIDC Client.#1703SradhaMohanty5899 wants to merge 9 commits into
Conversation
Signed-off-by: Sradha Mohanty <mohantysradha10@gmail.com>
Signed-off-by: Sradha Mohanty <mohantysradha10@gmail.com>
|
Warning Review limit reached
More reviews will be available in 53 minutes and 49 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds DBValidator test implementation and DBValidatorTest YAML; adds OIDC CreateOIDCClient test cases and templates; adds partner-policy mapping and approve-mapping YAMLs; registers DBValidator and AuditValidator in TestNG suites; updates environment properties for QA and test timing. ChangeseSignet tests and config
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 10
🧹 Nitpick comments (9)
api-test/src/main/resources/esignet/OidcClient/OIDCClient2.hbs (1)
9-14:grantTypesandclientAuthMethodssupport only single values.The template wraps
{{grantTypes}}and{{clientAuthMethods}}in arrays with quoted strings, which means they can only hold a single value each. If multiple grant types or client auth methods are needed, this will produce invalid JSON (e.g.,["value1,value2"]instead of["value1", "value2"]).Consider using triple braces
{{{...}}}similar toredirectUrisif array values need to be passed from YAML, or verify this single-value limitation is intentional for the specific test scenarios using this template.💡 Possible fix if multiple values are needed
- "grantTypes": [ - "{{grantTypes}}" - ], - "clientAuthMethods": [ - "{{clientAuthMethods}}" - ] + "grantTypes": {{{grantTypes}}}, + "clientAuthMethods": {{{clientAuthMethods}}}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api-test/src/main/resources/esignet/OidcClient/OIDCClient2.hbs` around lines 9 - 14, The template currently renders grantTypes and clientAuthMethods as single quoted string entries inside arrays, which forces single values (e.g., ["a,b"]) and breaks JSON when multiple values are passed; update the OIDCClient2.hbs template to emit arrays for these fields like redirectUris does by using unescaped triple-stash placeholders (e.g., {{{grantTypes}}} and {{{clientAuthMethods}}}) or otherwise ensure the template receives already-JSON-encoded arrays so the resulting JSON is valid, and keep the placeholder names grantTypes and clientAuthMethods so the change is localized.api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.hbs (1)
1-6: All values are coerced to strings.This template wraps all values in quotes (
"{{this}}"), which means numeric or boolean values from the input will be rendered as strings. If the DB validator needs to compare non-string types, this could cause assertion mismatches.If type preservation is needed for certain fields, consider using a triple-stash
{{{this}}}for raw output or conditional logic for specific data types. However, if all DB query results are compared as strings, the current approach is acceptable.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.hbs` around lines 1 - 6, The template currently forces every value to a string by using "{{this}}"; update DBValidatorTest.hbs to preserve original types where needed by replacing the quoted interpolation with raw/unescaped output (use {{{this}}} instead of "{{this}}") or add conditional logic/handlebar helpers to emit numbers/booleans without surrounding quotes for specific keys; locate the Handlebars each-block in DBValidatorTest.hbs (the "{{`#each` this}} ... \"{{this}}\" ... {{/each}}") and change the interpolation strategy to preserve types or selectively quote values as required by the DB validator.api-test/testNgXmlFiles/esignetSuite.xml (1)
28-28: Normalize test name casing (AuditLogValidator).
AuditLogVAlidator(Line 28) looks like a typo and makes suite navigation/search harder.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api-test/testNgXmlFiles/esignetSuite.xml` at line 28, The test name "AuditLogVAlidator" is mis-cased; update the test element's name attribute to "AuditLogValidator" to normalize casing and fix search/navigation (look for the test tag whose name attribute equals "AuditLogVAlidator" and change it to "AuditLogValidator").api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.java (2)
37-39: Remove unused class fields.Similar to
AuditValidator, thetemplateFields(static List) andresponse(Response type) fields are declared but never used. Consider removing them.♻️ Proposed cleanup
public class DBValidator extends EsignetUtil implements ITest { private static final Logger logger = Logger.getLogger(DBValidator.class); protected String testCaseName = ""; - public static List<String> templateFields = new ArrayList<>(); - public Response response = null;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.java` around lines 37 - 39, Remove the unused fields templateFields (public static List<String> templateFields = new ArrayList<>();) and response (public Response response = null;) from the DBValidator class; delete any now-unused imports (e.g., java.util.List, java.util.ArrayList, and the Response type import) and run a quick build to ensure no remaining references to templateFields or response exist elsewhere in the class or project before committing.
91-94: SQL query construction via string concatenation.The query is built by concatenating the endpoint (SQL fragment) with filter values. While inputs come from controlled YAML test configurations, consider documenting this assumption clearly or adding input validation to prevent potential issues with malformed test data.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.java` around lines 91 - 94, The code builds an SQL string by concatenating testCaseDTO.getEndPoint(), filterId and jsonObject.getString(filterId) before calling DBManager.executeQueryAndGetRecord, which risks malformed queries; either (A) stop concatenating raw values and refactor to use a parameterized call (extend DBManager.executeQueryAndGetRecord to accept a query template with placeholders and a params map from jsonObject.getString(filterId)), or (B) if you keep the current call, add explicit validation/whitelisting and escaping for filterId and the value returned by jsonObject.getString(filterId) (validate against expected patterns from the YAML and document the controlled-input assumption in DBValidator), and then pass the sanitized value to DBManager.executeQueryAndGetRecord; reference DBValidator, testCaseDTO.getEndPoint(), filterId, jsonObject.getString(filterId), and DBManager.executeQueryAndGetRecord when making the change.api-test/testNgXmlFiles/esignetPrerequisiteSuite.xml (1)
114-132: Consider addingprerequisiteparameter for consistency.The new
partnerPolicyMappingandApprovePartnerPolicyMappingtests are missing the<parameter name="prerequisite" value="Yes" />parameter that most other tests in this suite include (e.g.,CreatePolicyGroup,DefinePolicy,PublishPolicy, etc.). If these tests are intended to be prerequisites, add the parameter for consistency. Otherwise, this can be ignored if intentional.♻️ Proposed fix
<test name="partnerPolicyMapping"> <parameter name="ymlFile" value="esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMapping.yml" /> <parameter name="idKeyName" value="mappingkey" /> <parameter name="pathParams" value="partnerId" /> + <parameter name="prerequisite" value="Yes" /> <classes> <class name="io.mosip.testrig.apirig.esignet.testscripts.PostWithBodyAndPathParams" /> </classes> </test> <test name="ApprovePartnerPolicyMapping"> <parameter name="ymlFile" value="esignet/PmsIntegration/ApprovePartnerPolicyMapping/ApproveMappingKey.yml" /> <parameter name="pathParams" value="mappingkey" /> + <parameter name="prerequisite" value="Yes" /> <classes> <class name="io.mosip.testrig.apirig.esignet.testscripts.PutWithPathParamsAndBody" /> </classes> </test>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api-test/testNgXmlFiles/esignetPrerequisiteSuite.xml` around lines 114 - 132, The partnerPolicyMapping and ApprovePartnerPolicyMapping test entries are missing the consistent prerequisite parameter; update the <test name="partnerPolicyMapping"> and <test name="ApprovePartnerPolicyMapping"> blocks to include <parameter name="prerequisite" value="Yes" /> (placed alongside the other <parameter> elements) so they match other prerequisite tests like CreatePolicyGroup/DefinePolicy/PublishPolicy.api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/AuditValidator.java (3)
79-83: SQL query constructed via string concatenation.While this is an internal test framework with controlled inputs, using parameterized queries or at minimum validating/escaping the
partner_userNamevalue would be safer practice. The current approach could be vulnerable if configuration values contain unexpected characters.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/AuditValidator.java` around lines 79 - 83, The SQL is built via string concatenation in AuditValidator (the local variable query) using BaseTestCase.currentModule and EsignetConfigManager.getproperty("partner_userName"); change this to use a parameterized query (or a DBManager method that accepts query parameters) instead of concatenation, or at minimum validate/escape the partner_userName value before embedding it; update the call to DBManager.executeQueryAndGetRecord to pass the parameterized SQL and the partner_userName (or the escaped/validated value) so the query is safe from malformed/config-driven input.
37-38: Remove or utilize unused class fields.
templateFields(static List) andresponse(Response type) are declared but never used. Theresponsefield shadows the localMap<String, Object> responsevariable in the test method. Consider removing these unused fields to reduce confusion.♻️ Proposed cleanup
public class AuditValidator extends EsignetUtil implements ITest { private static final Logger logger = Logger.getLogger(AuditValidator.class); protected String testCaseName = ""; - public static List<String> templateFields = new ArrayList<>(); - public Response response = null;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/AuditValidator.java` around lines 37 - 38, The class AuditValidator declares unused fields templateFields (static List<String>) and response (Response) and the latter shadows a local Map<String,Object> response in the test method; remove both unused fields from AuditValidator to eliminate confusion and shadowing, or if you intend to reuse them convert the local Map variable to a different name or use the class fields consistently (refer to templateFields and response in AuditValidator to locate them).
76-77:templateFieldsfrom DTO is fetched but not used.The
templateFieldsarray is retrieved fromtestCaseDTOand converted to a list, but it's only logged and never used in the query construction or validation logic. If this is intentional placeholder code for future use, consider adding a TODO comment. Otherwise, remove the unused code.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/AuditValidator.java` around lines 76 - 77, The code retrieves templateFields from testCaseDTO and converts it to queryProp but never uses it; either remove these two lines (String[] templateFields = testCaseDTO.getTemplateFields(); List<String> queryProp = Arrays.asList(templateFields);) or integrate queryProp into the query/validation logic in AuditValidator (e.g., use queryProp when building the search/filter criteria or validation checks related to template fields); if this is intentional placeholder code, replace the lines with a clear TODO comment referencing templateFields/queryProp and the AuditValidator class so future work knows why they exist.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/AuditValidator.java`:
- Around line 107-116: The deleteQuery in setResultTestName currently uses only
EsignetConfigManager.getproperty("partner_userName"), but the select used when
validating records included the module prefix (currentModule + "-" +
partner_userName), so DBManager.executeQueryAndDeleteRecord("audit",
deleteQuery) won't remove the same rows; update the deleteQuery construction in
AuditValidator.setResultTestName to build cr_by exactly the same way as the
select (prefix partner_userName with currentModule + "-" using the same variable
names and quoting), keeping the existing logger.info and DBManager call.
In
`@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.java`:
- Around line 83-91: DBValidator builds a query using filterId derived from
jsonObject.keySet() but does not handle the empty-key case, producing malformed
queries; update the code in DBValidator to validate jsonObject.keySet() before
using filterId: if jsonObject.keySet() is empty, either throw a clear
IllegalArgumentException (or return/fail the test) with a descriptive message,
and log the condition via logger (e.g., include jsonObject in the log),
otherwise safely extract the first key (filterId) and build the query using
testCaseDTO.getEndPoint() and jsonObject.getString(filterId); ensure no attempt
to call jsonObject.getString("") occurs and that downstream code expects the
exception/return.
In `@api-test/src/main/resources/esignet/AuditLog/AuditLog.yml`:
- Around line 13-16: The expected JSON in the AuditLog.yml "output" value is
invalid because the properties are missing a comma; update the "output" string
in AuditLog.yml (the output mapping for the AuditLog fixture) to be valid JSON
by inserting the missing comma between "module_name" and "cr_by" and ensure
proper quoting/escaping so the entire value remains a single valid JSON string;
after editing, validate the JSON syntax to confirm the payload is well-formed.
In
`@api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.yml`:
- Around line 2-42: The three DB validator cases (uniqueIdentifier
TC_Esignet_DBValidator_01, TC_Esignet_DBValidator_02, TC_Esignet_DBValidator_03)
rely on the producer substitution token
$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$ but no dependency is
recorded; add an explicit dependency on the producing test
(CreateOIDCClient_all_Valid_Smoke_sid or equivalent producer) either by adding
the inline dependency metadata to these YAML entries or by registering these
three test IDs in the appropriate centralized dependency config
(testCaseInterDependency_mock.json / testCaseInterDependency_mosip-id.json /
testCaseInterDependency_sunbirdrc.json) so the producer runs before the DB
validators and the $ID substitution resolves reliably.
In `@api-test/src/main/resources/esignet/OidcClient/OIDCClient.yml`:
- Line 882: Remove the excessive trailing whitespace after the
"authorization_code" value for the "grantTypes" key in OIDCClient.yml; locate
the line containing "grantTypes": "authorization_code" and trim any trailing
spaces so the value ends immediately after the closing quote, preserving YAML
formatting and file encoding.
- Line 700: The test case name contains a typo: rename the YAML key
Esignet_CreateOIDCClient_With_DataSharePlocy_Neg to
Esignet_CreateOIDCClient_With_DataSharePolicy_Neg (update any references to that
key if used elsewhere) so the test name correctly reads "DataSharePolicy";
adjust any related test identifiers or aliases that reference the old key.
- Around line 778-782: The description for the test case key
Esignet_CreateOIDCClient_With_Same_AuthPartner_With_Diff_Policy_Neg is incorrect
— change the description value from "Create OIDC client With Not Approved
Policy" to accurately reflect the test intent, e.g., "Create OIDC client with
same auth partner but different policy (negative)" so the description matches
the test name and purpose; update the description field in the OIDCClient.yml
entry for Esignet_CreateOIDCClient_With_Same_AuthPartner_With_Diff_Policy_Neg
accordingly.
In
`@api-test/src/main/resources/esignet/PmsIntegration/ApprovePartnerPolicyMapping/ApproveMappingKey.yml`:
- Around line 2-15: The Esignet_ApproveMappingKey_All_Valid_Smoke test consumes
the produced ID token "$ID:partnerPolicyMapping_All_Valid_Smoke_sid_mappingkey$"
but declares no dependency; add an explicit dependency to ensure sequencing by
either adding additionalDependencies: [TC_PMS_PartnerPolicyMapping_01] to the
Esignet_ApproveMappingKey_All_Valid_Smoke test block in ApproveMappingKey.yml or
register TC_PMS_PartnerPolicyMapping_01 in the centralized
testCaseInterDependency_*.json configuration so the producer
(TC_PMS_PartnerPolicyMapping_01) runs before this consumer.
In
`@api-test/src/main/resources/esignet/PmsIntegration/PublishPolicy/PublishPolicy.yml`:
- Around line 206-264: The three test cases
Esignet_PublishPolicy_For_Policy_WithOut_AllowedAuthTypes_Smoke,
Esignet_PublishPolicy_For_Policy_WithOut_AllowedKycAttributes_Smoke, and
Esignet_PublishPolicy_For_Policy_WithOut_FullName_Email_Gender_Smoke currently
share a generic description ("Publish policy Auth with all valid details");
update each description to accurately describe the edge case it validates (e.g.,
"Publish policy missing AllowedAuthTypes", "Publish policy missing
AllowedKycAttributes", "Publish policy missing FullName/Email/Gender") so the
description matches the test name and intent.
In
`@api-test/src/main/resources/esignet/PmsIntegration/UploadCert/UploadCert.yml`:
- Around line 146-153: The test entry
Esignet_UploadPartnerCert_For_Credential_Partner_Smoke has incorrect
additionalDependencies referencing Dependent_Idrepo_uploadCACert_01 and
Dependent_Idrepo_uploadCACert_02 (Auth_Partner CA certs); update the
additionalDependencies value to use the Credential Partner CA cert identifiers
Dependent_Idrepo_uploadCACert_17 and Dependent_Idrepo_uploadSubCACert_18 so the
test depends on the correct CA and intermediate certs used by
PartnerSelfRegistration_For_Credential_Partner_sid.
---
Nitpick comments:
In
`@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/AuditValidator.java`:
- Around line 79-83: The SQL is built via string concatenation in AuditValidator
(the local variable query) using BaseTestCase.currentModule and
EsignetConfigManager.getproperty("partner_userName"); change this to use a
parameterized query (or a DBManager method that accepts query parameters)
instead of concatenation, or at minimum validate/escape the partner_userName
value before embedding it; update the call to DBManager.executeQueryAndGetRecord
to pass the parameterized SQL and the partner_userName (or the escaped/validated
value) so the query is safe from malformed/config-driven input.
- Around line 37-38: The class AuditValidator declares unused fields
templateFields (static List<String>) and response (Response) and the latter
shadows a local Map<String,Object> response in the test method; remove both
unused fields from AuditValidator to eliminate confusion and shadowing, or if
you intend to reuse them convert the local Map variable to a different name or
use the class fields consistently (refer to templateFields and response in
AuditValidator to locate them).
- Around line 76-77: The code retrieves templateFields from testCaseDTO and
converts it to queryProp but never uses it; either remove these two lines
(String[] templateFields = testCaseDTO.getTemplateFields(); List<String>
queryProp = Arrays.asList(templateFields);) or integrate queryProp into the
query/validation logic in AuditValidator (e.g., use queryProp when building the
search/filter criteria or validation checks related to template fields); if this
is intentional placeholder code, replace the lines with a clear TODO comment
referencing templateFields/queryProp and the AuditValidator class so future work
knows why they exist.
In
`@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.java`:
- Around line 37-39: Remove the unused fields templateFields (public static
List<String> templateFields = new ArrayList<>();) and response (public Response
response = null;) from the DBValidator class; delete any now-unused imports
(e.g., java.util.List, java.util.ArrayList, and the Response type import) and
run a quick build to ensure no remaining references to templateFields or
response exist elsewhere in the class or project before committing.
- Around line 91-94: The code builds an SQL string by concatenating
testCaseDTO.getEndPoint(), filterId and jsonObject.getString(filterId) before
calling DBManager.executeQueryAndGetRecord, which risks malformed queries;
either (A) stop concatenating raw values and refactor to use a parameterized
call (extend DBManager.executeQueryAndGetRecord to accept a query template with
placeholders and a params map from jsonObject.getString(filterId)), or (B) if
you keep the current call, add explicit validation/whitelisting and escaping for
filterId and the value returned by jsonObject.getString(filterId) (validate
against expected patterns from the YAML and document the controlled-input
assumption in DBValidator), and then pass the sanitized value to
DBManager.executeQueryAndGetRecord; reference DBValidator,
testCaseDTO.getEndPoint(), filterId, jsonObject.getString(filterId), and
DBManager.executeQueryAndGetRecord when making the change.
In
`@api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.hbs`:
- Around line 1-6: The template currently forces every value to a string by
using "{{this}}"; update DBValidatorTest.hbs to preserve original types where
needed by replacing the quoted interpolation with raw/unescaped output (use
{{{this}}} instead of "{{this}}") or add conditional logic/handlebar helpers to
emit numbers/booleans without surrounding quotes for specific keys; locate the
Handlebars each-block in DBValidatorTest.hbs (the "{{`#each` this}} ...
\"{{this}}\" ... {{/each}}") and change the interpolation strategy to preserve
types or selectively quote values as required by the DB validator.
In `@api-test/src/main/resources/esignet/OidcClient/OIDCClient2.hbs`:
- Around line 9-14: The template currently renders grantTypes and
clientAuthMethods as single quoted string entries inside arrays, which forces
single values (e.g., ["a,b"]) and breaks JSON when multiple values are passed;
update the OIDCClient2.hbs template to emit arrays for these fields like
redirectUris does by using unescaped triple-stash placeholders (e.g.,
{{{grantTypes}}} and {{{clientAuthMethods}}}) or otherwise ensure the template
receives already-JSON-encoded arrays so the resulting JSON is valid, and keep
the placeholder names grantTypes and clientAuthMethods so the change is
localized.
In `@api-test/testNgXmlFiles/esignetPrerequisiteSuite.xml`:
- Around line 114-132: The partnerPolicyMapping and ApprovePartnerPolicyMapping
test entries are missing the consistent prerequisite parameter; update the <test
name="partnerPolicyMapping"> and <test name="ApprovePartnerPolicyMapping">
blocks to include <parameter name="prerequisite" value="Yes" /> (placed
alongside the other <parameter> elements) so they match other prerequisite tests
like CreatePolicyGroup/DefinePolicy/PublishPolicy.
In `@api-test/testNgXmlFiles/esignetSuite.xml`:
- Line 28: The test name "AuditLogVAlidator" is mis-cased; update the test
element's name attribute to "AuditLogValidator" to normalize casing and fix
search/navigation (look for the test tag whose name attribute equals
"AuditLogVAlidator" and change it to "AuditLogValidator").
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0b6db21e-ca0d-4789-8d38-984e24a7b413
📒 Files selected for processing (29)
api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/AuditValidator.javaapi-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.javaapi-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithBodyAndPathParams.javaapi-test/src/main/resources/esignet/AuditLog/AuditLog.ymlapi-test/src/main/resources/esignet/AuditLog/AuditLogResult.hbsapi-test/src/main/resources/esignet/AuditLog/auditlog.hbsapi-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.hbsapi-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.ymlapi-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTestResult.hbsapi-test/src/main/resources/esignet/OidcClient/OIDCClient.ymlapi-test/src/main/resources/esignet/OidcClient/OIDCClient2.hbsapi-test/src/main/resources/esignet/PmsIntegration/ApprovePartnerPolicyMapping/ApproveMappingKey.ymlapi-test/src/main/resources/esignet/PmsIntegration/ApprovePartnerPolicyMapping/approveMappingKey.hbsapi-test/src/main/resources/esignet/PmsIntegration/ApprovePartnerPolicyMapping/approveMappingKeyResult.hbsapi-test/src/main/resources/esignet/PmsIntegration/CreatePartner/CreatePartner.ymlapi-test/src/main/resources/esignet/PmsIntegration/DefinePolicy/DefinePolicy.ymlapi-test/src/main/resources/esignet/PmsIntegration/DefinePolicy/defineDataSharePolicy.hbsapi-test/src/main/resources/esignet/PmsIntegration/DefinePolicy/definePolicy2.hbsapi-test/src/main/resources/esignet/PmsIntegration/DefinePolicy/definePolicy3.hbsapi-test/src/main/resources/esignet/PmsIntegration/DefinePolicy/definePolicy4.hbsapi-test/src/main/resources/esignet/PmsIntegration/DefinePolicyGroup/DefinePolicyGroup.ymlapi-test/src/main/resources/esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMapping.hbsapi-test/src/main/resources/esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMapping.ymlapi-test/src/main/resources/esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMappingResult.hbsapi-test/src/main/resources/esignet/PmsIntegration/PublishPolicy/PublishPolicy.ymlapi-test/src/main/resources/esignet/PmsIntegration/UploadCert/UploadCert.ymlapi-test/src/main/resources/esignet/PmsIntegration/UploadCertificate/UploadCertificate.ymlapi-test/testNgXmlFiles/esignetPrerequisiteSuite.xmlapi-test/testNgXmlFiles/esignetSuite.xml
| Set<String> set = new TreeSet<>(); | ||
| set.addAll(jsonObject.keySet()); | ||
| String filterId = ""; | ||
|
|
||
| if (set.stream().findFirst().isPresent()) | ||
| filterId = set.stream().findFirst().get(); | ||
|
|
||
| logger.info(filterId); | ||
| String query = testCaseDTO.getEndPoint() + " " + filterId + " = " + "'" + jsonObject.getString(filterId) + "'"; |
There was a problem hiding this comment.
Handle case where JSON input has no keys.
If jsonObject.keySet() is empty, filterId remains an empty string, and the query on line 91 becomes malformed (e.g., "SELECT * FROM pms.oidc_client where = 'null'"). Consider adding validation or throwing a meaningful exception.
🛡️ Proposed fix to validate JSON keys
Set<String> set = new TreeSet<>();
set.addAll(jsonObject.keySet());
String filterId = "";
- if (set.stream().findFirst().isPresent())
+ if (set.stream().findFirst().isPresent()) {
filterId = set.stream().findFirst().get();
+ } else {
+ throw new AdminTestException("Input JSON must contain at least one key for DB query filter");
+ }
logger.info(filterId);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.java`
around lines 83 - 91, DBValidator builds a query using filterId derived from
jsonObject.keySet() but does not handle the empty-key case, producing malformed
queries; update the code in DBValidator to validate jsonObject.keySet() before
using filterId: if jsonObject.keySet() is empty, either throw a clear
IllegalArgumentException (or return/fail the test) with a descriptive message,
and log the condition via logger (e.g., include jsonObject in the log),
otherwise safely extract the first key (filterId) and build the query using
testCaseDTO.getEndPoint() and jsonObject.getString(filterId); ensure no attempt
to call jsonObject.getString("") occurs and that downstream code expects the
exception/return.
| Esignet_DBValidator_All_Valid_Smoke_data_created_for_OIDCClient: | ||
| endPoint: SELECT * FROM pms.oidc_client where | ||
| uniqueIdentifier: TC_Esignet_DBValidator_01 | ||
| description: Validate that data created for OIDCClient is correctly stored and consistent in the pms database | ||
| role: partner | ||
| restMethod: post | ||
| inputTemplate: esignet/DBValidatorAndAuditValidator/DBValidatorTest | ||
| outputTemplate: esignet/DBValidatorAndAuditValidator/DBValidatorTestResult | ||
| input: '{ | ||
| "id": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$" | ||
| }' | ||
| output: '{ | ||
| }' | ||
|
|
||
| Esignet_DBValidator_All_Valid_Smoke_data_created_for_OIDCClient_Client_detail: | ||
| endPoint: SELECT * FROM esignet.client_detail where | ||
| uniqueIdentifier: TC_Esignet_DBValidator_02 | ||
| description: Validate that data created for OIDCClient client details is correctly stored and consistent in the esignet database | ||
| role: partner | ||
| restMethod: post | ||
| inputTemplate: esignet/DBValidatorAndAuditValidator/DBValidatorTest | ||
| outputTemplate: esignet/DBValidatorAndAuditValidator/DBValidatorTestResult | ||
| input: '{ | ||
| "id": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$" | ||
| }' | ||
| output: '{ | ||
| }' | ||
|
|
||
| Esignet_DBValidator_All_Valid_Smoke_data_created_for_OIDCClient_Using_IDA: | ||
| endPoint: SELECT * FROM ida.oidc_client_data where | ||
| uniqueIdentifier: TC_Esignet_DBValidator_03 | ||
| description: Validate that data created for OIDCClient client details is correctly stored and consistent in the ida database | ||
| role: partner | ||
| restMethod: post | ||
| inputTemplate: esignet/DBValidatorAndAuditValidator/DBValidatorTest | ||
| outputTemplate: esignet/DBValidatorAndAuditValidator/DBValidatorTestResult | ||
| input: '{ | ||
| "oidc_client_id": "$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$" | ||
| }' | ||
| output: '{ | ||
| }' No newline at end of file |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== DBValidator consumer tests ==="
rg -n "TC_Esignet_DBValidator_0[1-3]|CreateOIDCClient_all_Valid_Smoke_sid_clientId|additionalDependencies" \
api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.yml
echo "=== Locate producer testcase + uniqueIdentifier ==="
rg -n "CreateOIDCClient_all_Valid_Smoke_sid|uniqueIdentifier" \
api-test/src/main/resources/esignet -g '*.yml'
echo "=== Centralized dependency maps ==="
fd "testCaseInterDependency_.*\\.json" api-test/src/main/resources/config \
-x sh -c 'echo "--- {} ---"; rg -n "TC_Esignet_DBValidator_0[1-3]|CreateOIDCClient_all_Valid_Smoke_sid" "{}"'Repository: mosip/esignet
Length of output: 50370
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Search for producer test: CreateOIDCClient + all_Valid_Smoke ==="
rg -l "CreateOIDCClient" api-test/src/main/resources/esignet -g '*.yml' | head -5
echo "=== Check specific OIDC client creation test file ==="
fd "PatchOIDCClient\|CreateOIDCClient" api-test/src/main/resources/esignet -type f -name "*.yml"
echo "=== Search in root esignet test directory for CreateOIDCClient ==="
rg "uniqueIdentifier.*CreateOIDCClient|CreateOIDCClient.*uniqueIdentifier" \
api-test/src/main/resources/esignet -A 1 -B 1 | head -30
echo "=== Check centralized dependency JSON files for DBValidator ==="
find api-test/src/main/resources/config -name "testCaseInterDependency*.json" -exec sh -c '
echo "=== {} ==="
jq . "{}" 2>/dev/null | grep -A 5 -B 5 "DBValidator\|CreateOIDCClient" || echo "No match"
' \;Repository: mosip/esignet
Length of output: 794
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Find OIDC client creation test files ==="
fd "CreateOIDCClient\|PatchOIDCClient" api-test/src/main/resources/esignet
echo "=== Search for all_Valid_Smoke test case definition ==="
rg "all_Valid_Smoke" api-test/src/main/resources/esignet -l -g '*.yml'
echo "=== Search for uniqueIdentifier containing CreateOIDCClient ==="
rg "uniqueIdentifier:.*CreateOIDCClient|uniqueIdentifier:.*Smoke" \
api-test/src/main/resources/esignet -g '*.yml' | head -20
echo "=== List centralized config files ==="
ls -la api-test/src/main/resources/config/testCaseInterDependency*
echo "=== Check testCaseInterDependency files for DBValidator or Smoke ==="
for file in api-test/src/main/resources/config/testCaseInterDependency*.json; do
if [ -f "$file" ]; then
echo "=== File: $file ==="
rg "DBValidator|Smoke|CreateOIDCClient" "$file" -c
fi
doneRepository: mosip/esignet
Length of output: 13554
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Check testCaseInterDependency_mock.json for DBValidator entries ==="
jq '.[] | select(.testcaseId | contains("DBValidator")) | {testcaseId, dependencies}' \
api-test/src/main/resources/config/testCaseInterDependency_mock.json | head -60
echo "=== Search for producer test that outputs CreateOIDCClient_all_Valid_Smoke_sid_clientId ==="
rg "outputIdentifier|all_Valid_Smoke_sid" api-test/src/main/resources/esignet -A 2 -B 2 -g '*.yml' | head -40
echo "=== Check mock dependency file for entries related to CreateOIDCClient_all_Valid_Smoke ==="
jq '.[] | select(.outputIdentifier | contains("all_Valid_Smoke")) | {testcaseId, outputIdentifier}' \
api-test/src/main/resources/config/testCaseInterDependency_mock.jsonRepository: mosip/esignet
Length of output: 279
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Check JSON structure ==="
jq '.[0]' api-test/src/main/resources/config/testCaseInterDependency_mock.json
echo "=== Search for DBValidator entries in array ==="
jq '.[] | select(.testcaseId and (.testcaseId | contains("DBValidator"))) | {testcaseId: .testcaseId, dependencies: .dependencies}' \
api-test/src/main/resources/config/testCaseInterDependency_mock.json
echo "=== Search for entries with all_Valid_Smoke in output ==="
jq '.[] | select(.outputIdentifier and (.outputIdentifier | contains("all_Valid_Smoke"))) | {testcaseId: .testcaseId, outputIdentifier: .outputIdentifier}' \
api-test/src/main/resources/config/testCaseInterDependency_mock.jsonRepository: mosip/esignet
Length of output: 224
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Check file structure ==="
head -5 api-test/src/main/resources/config/testCaseInterDependency_mock.json
tail -5 api-test/src/main/resources/config/testCaseInterDependency_mock.json
echo "=== Search for DBValidator in dependency files with grep ==="
grep -n "DBValidator\|CreateOIDCClient_all_Valid_Smoke" \
api-test/src/main/resources/config/testCaseInterDependency_mock.json | head -20
echo "=== Check if CreateOIDCClient_all_Valid_Smoke_sid exists anywhere in YAML ==="
rg -l "CreateOIDCClient_all_Valid_Smoke_sid[^_]" api-test/src/main/resources/esignet -g '*.yml' | head -10
echo "=== Find what outputs the ID CreateOIDCClient_all_Valid_Smoke_sid_clientId ==="
rg "outputIdentifier.*CreateOIDCClient_all_Valid_Smoke_sid|all_Valid_Smoke.*outputIdentifier" \
api-test/src/main/resources/esignet -g '*.yml'Repository: mosip/esignet
Length of output: 597
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Search ALL dependency files for DBValidator ==="
for file in api-test/src/main/resources/config/testCaseInterDependency*.json; do
echo "File: $file"
grep -c "DBValidator" "$file" || echo "Not found"
done
echo "=== Search ALL dependency files for CreateOIDCClient entries ==="
grep "CreateOIDCClient" api-test/src/main/resources/config/testCaseInterDependency_mock.json | head -10
echo "=== Find test case with all_Valid_Smoke in name or output ==="
rg "all_Valid_Smoke" api-test/src/main/resources/esignet -g '*.yml' -B 5 -A 1 | grep -E "(uniqueIdentifier|outputIdentifier|all_Valid_Smoke)" | head -30
echo "=== Check CreateOIDCClientV2 or V3 files for smoke tests ==="
fd "CreateOIDCClient" api-test/src/main/resources/esignet -type d
echo "=== Look at OidcClient.yml which appeared in earlier results ==="
rg "all_Valid_Smoke|outputIdentifier|CreateOIDCClient_all_Valid_Smoke" \
api-test/src/main/resources/esignet/OidcClient/OIDCClient.yml -A 2 -B 2Repository: mosip/esignet
Length of output: 6078
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Search for producer test outputIdentifier for all_Valid_Smoke_sid ==="
rg "outputIdentifier.*all_Valid_Smoke_sid|all_Valid_Smoke.*outputIdentifier" \
api-test/src/main/resources/esignet -g '*.yml' -A 1 -B 2
echo "=== Check DBValidatorTest.yml for additionalDependencies ==="
cat api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.yml | head -50
echo "=== Search in entire codebase for CreateOIDCClient_all_Valid_Smoke_sid as outputIdentifier ==="
rg "CreateOIDCClient_all_Valid_Smoke_sid" api-test/src/main/resources/esignet -g '*.yml' -B 10 | grep -E "(uniqueIdentifier|outputIdentifier|test.*:$)" | head -20Repository: mosip/esignet
Length of output: 130
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Full content of DBValidatorTest.yml ==="
cat api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.yml
echo "=== Search for any test case with 'CreateOIDCClient_all_Valid_Smoke_sid_clientId' as outputIdentifier ==="
rg "CreateOIDCClient_all_Valid_Smoke_sid_clientId" api-test/src/main/resources/esignet -g '*.yml' -B 15 | grep -E "uniqueIdentifier|outputIdentifier" | head -20
echo "=== Find which test produces clientId output ==="
rg "outputIdentifier.*clientId" api-test/src/main/resources/esignet -g '*.yml' -B 2 | head -40Repository: mosip/esignet
Length of output: 4897
Add/verify dependency on OIDC client producer test before $ID: substitution.
All three DB checks depend on $ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$. This YAML has no inline dependency metadata, and the test cases (TC_Esignet_DBValidator_01, TC_Esignet_DBValidator_02, TC_Esignet_DBValidator_03) are not registered in any of the centralized dependency config files (testCaseInterDependency_mock.json, testCaseInterDependency_mosip-id.json, testCaseInterDependency_sunbirdrc.json). Verify that the producer test for this client ID exists and is explicitly linked; otherwise, execution order can break these tests.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.yml`
around lines 2 - 42, The three DB validator cases (uniqueIdentifier
TC_Esignet_DBValidator_01, TC_Esignet_DBValidator_02, TC_Esignet_DBValidator_03)
rely on the producer substitution token
$ID:CreateOIDCClient_all_Valid_Smoke_sid_clientId$ but no dependency is
recorded; add an explicit dependency on the producing test
(CreateOIDCClient_all_Valid_Smoke_sid or equivalent producer) either by adding
the inline dependency metadata to these YAML entries or by registering these
three test IDs in the appropriate centralized dependency config
(testCaseInterDependency_mock.json / testCaseInterDependency_mosip-id.json /
testCaseInterDependency_sunbirdrc.json) so the producer runs before the DB
validators and the $ID substitution resolves reliably.
| Esignet_CreateOIDCClient_With_Same_AuthPartner_With_Diff_Policy_Neg: | ||
| endPoint: /v1/partnermanager/oidc/client | ||
| uniqueIdentifier: TC_ESignet_CreateOIDCClient_MOSIPID_32 | ||
| description: Create OIDC client With Not Approved Policy | ||
| role: partner |
There was a problem hiding this comment.
Description doesn't match test purpose.
The description says "Create OIDC client With Not Approved Policy" but the test name indicates it's testing "Same AuthPartner With Diff Policy". This appears to be a copy-paste error from the previous test case.
✏️ Proposed fix
Esignet_CreateOIDCClient_With_Same_AuthPartner_With_Diff_Policy_Neg:
endPoint: /v1/partnermanager/oidc/client
uniqueIdentifier: TC_ESignet_CreateOIDCClient_MOSIPID_32
- description: Create OIDC client With Not Approved Policy
+ description: Create OIDC client with same auth partner but different policy
role: partner📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Esignet_CreateOIDCClient_With_Same_AuthPartner_With_Diff_Policy_Neg: | |
| endPoint: /v1/partnermanager/oidc/client | |
| uniqueIdentifier: TC_ESignet_CreateOIDCClient_MOSIPID_32 | |
| description: Create OIDC client With Not Approved Policy | |
| role: partner | |
| Esignet_CreateOIDCClient_With_Same_AuthPartner_With_Diff_Policy_Neg: | |
| endPoint: /v1/partnermanager/oidc/client | |
| uniqueIdentifier: TC_ESignet_CreateOIDCClient_MOSIPID_32 | |
| description: Create OIDC client with same auth partner but different policy | |
| role: partner |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@api-test/src/main/resources/esignet/OidcClient/OIDCClient.yml` around lines
778 - 782, The description for the test case key
Esignet_CreateOIDCClient_With_Same_AuthPartner_With_Diff_Policy_Neg is incorrect
— change the description value from "Create OIDC client With Not Approved
Policy" to accurately reflect the test intent, e.g., "Create OIDC client with
same auth partner but different policy (negative)" so the description matches
the test name and purpose; update the description field in the OIDCClient.yml
entry for Esignet_CreateOIDCClient_With_Same_AuthPartner_With_Diff_Policy_Neg
accordingly.
| Esignet_ApproveMappingKey_All_Valid_Smoke: | ||
| endPoint: /v1/partnermanager/partners/policy/{mappingkey} | ||
| uniqueIdentifier: TC_PMS_ApproveAPIKey_01 | ||
| description: Validate that a mapping key is successfully approved when all input parameters are valid | ||
| role: partner | ||
| checkErrorsOnlyInResponse: true | ||
| restMethod: put | ||
| inputTemplate: esignet/PmsIntegration/ApprovePartnerPolicyMapping/approveMappingKey | ||
| outputTemplate: esignet/PmsIntegration/ApprovePartnerPolicyMapping/approveMappingKeyResult | ||
| input: '{ | ||
| "status": "Approved", | ||
| "mappingkey": "$ID:partnerPolicyMapping_All_Valid_Smoke_sid_mappingkey$", | ||
| "requesttime": "$TIMESTAMP$" | ||
| }' |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Consumer test (ApproveMappingKey) ==="
rg -n "TC_PMS_ApproveAPIKey_01|additionalDependencies|partnerPolicyMapping_All_Valid_Smoke_sid_mappingkey" \
api-test/src/main/resources/esignet/PmsIntegration/ApprovePartnerPolicyMapping/ApproveMappingKey.yml
echo "=== Producer test (partnerPolicyMapping) ==="
rg -n "Esignet_partnerPolicyMapping_All_Valid_Smoke_sid|uniqueIdentifier" \
api-test/src/main/resources/esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMapping.yml
echo "=== Centralized dependency maps ==="
fd "testCaseInterDependency_.*\\.json" api-test/src/main/resources/config \
-x sh -c 'echo "--- {} ---"; rg -n "TC_PMS_ApproveAPIKey_01|TC_PMS_PartnerPolicyMapping_01" "{}"'Repository: mosip/esignet
Length of output: 781
Add test dependency declaration for producer test sequencing.
This test consumes $ID:partnerPolicyMapping_All_Valid_Smoke_sid_mappingkey$ (from producer test TC_PMS_PartnerPolicyMapping_01) but declares no explicit dependency. Add either:
- Inline
additionalDependencies: [TC_PMS_PartnerPolicyMapping_01]to this test case, or - Entry in centralized config (
api-test/src/main/resources/config/testCaseInterDependency_*.json)
Without this, the test is order-sensitive and may fail unpredictably.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@api-test/src/main/resources/esignet/PmsIntegration/ApprovePartnerPolicyMapping/ApproveMappingKey.yml`
around lines 2 - 15, The Esignet_ApproveMappingKey_All_Valid_Smoke test consumes
the produced ID token "$ID:partnerPolicyMapping_All_Valid_Smoke_sid_mappingkey$"
but declares no dependency; add an explicit dependency to ensure sequencing by
either adding additionalDependencies: [TC_PMS_PartnerPolicyMapping_01] to the
Esignet_ApproveMappingKey_All_Valid_Smoke test block in ApproveMappingKey.yml or
register TC_PMS_PartnerPolicyMapping_01 in the centralized
testCaseInterDependency_*.json configuration so the producer
(TC_PMS_PartnerPolicyMapping_01) runs before this consumer.
| Esignet_PublishPolicy_For_Policy_WithOut_AllowedAuthTypes_Smoke: | ||
| endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish | ||
| uniqueIdentifier: Dependent_Idrepo_createPublishPolicy_11 | ||
| description: Publish policy Auth with all valid details | ||
| role: partner | ||
| restMethod: post | ||
| inputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicy | ||
| outputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicyMispResult | ||
| input: '{ | ||
| "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", | ||
| "policyId": "$ID:DefinePolicy_WithOut_AllowedAuthTypes_sid_id$", | ||
| "requesttime": "$TIMESTAMP$" | ||
| }' | ||
| output: '{ | ||
| "policyGroupStatus": "true", | ||
| "policyType": "Auth", | ||
| "status": "PUBLISHED", | ||
| "is_Active": "true" | ||
| }' | ||
|
|
||
| Esignet_PublishPolicy_For_Policy_WithOut_AllowedKycAttributes_Smoke: | ||
| endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish | ||
| uniqueIdentifier: Dependent_Idrepo_createPublishPolicy_12 | ||
| description: Publish policy Auth with all valid details | ||
| role: partner | ||
| restMethod: post | ||
| inputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicy | ||
| outputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicyMispResult | ||
| input: '{ | ||
| "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", | ||
| "policyId": "$ID:DefinePolicy_WithOut_AllowedKycAttributes_sid_id$", | ||
| "requesttime": "$TIMESTAMP$" | ||
| }' | ||
| output: '{ | ||
| "policyGroupStatus": "true", | ||
| "policyType": "Auth", | ||
| "status": "PUBLISHED", | ||
| "is_Active": "true" | ||
| }' | ||
|
|
||
| Esignet_PublishPolicy_For_Policy_WithOut_FullName_Email_Gender_Smoke: | ||
| endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish | ||
| uniqueIdentifier: Dependent_Idrepo_createPublishPolicy_13 | ||
| description: Publish policy Auth with all valid details | ||
| role: partner | ||
| restMethod: post | ||
| inputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicy | ||
| outputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicyMispResult | ||
| input: '{ | ||
| "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", | ||
| "policyId": "$ID:DefinePolicy_WithOut_FullName_Email_Gender_sid_id$", | ||
| "requesttime": "$TIMESTAMP$" | ||
| }' | ||
| output: '{ | ||
| "policyGroupStatus": "true", | ||
| "policyType": "Auth", | ||
| "status": "PUBLISHED", | ||
| "is_Active": "true" | ||
| }' No newline at end of file |
There was a problem hiding this comment.
Test case descriptions do not reflect their specific purpose.
The description fields for these three test cases all read "Publish policy Auth with all valid details", but the test names indicate they test edge cases with missing policy attributes (WithOut_AllowedAuthTypes, WithOut_AllowedKycAttributes, WithOut_FullName_Email_Gender). Consider updating the descriptions to accurately reflect what each test validates.
Suggested description updates
Esignet_PublishPolicy_For_Policy_WithOut_AllowedAuthTypes_Smoke:
endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish
uniqueIdentifier: Dependent_Idrepo_createPublishPolicy_11
- description: Publish policy Auth with all valid details
+ description: Publish policy without AllowedAuthTypes
role: partner
...
Esignet_PublishPolicy_For_Policy_WithOut_AllowedKycAttributes_Smoke:
endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish
uniqueIdentifier: Dependent_Idrepo_createPublishPolicy_12
- description: Publish policy Auth with all valid details
+ description: Publish policy without AllowedKycAttributes
role: partner
...
Esignet_PublishPolicy_For_Policy_WithOut_FullName_Email_Gender_Smoke:
endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish
uniqueIdentifier: Dependent_Idrepo_createPublishPolicy_13
- description: Publish policy Auth with all valid details
+ description: Publish policy without FullName, Email, and Gender attributes
role: partner📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Esignet_PublishPolicy_For_Policy_WithOut_AllowedAuthTypes_Smoke: | |
| endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish | |
| uniqueIdentifier: Dependent_Idrepo_createPublishPolicy_11 | |
| description: Publish policy Auth with all valid details | |
| role: partner | |
| restMethod: post | |
| inputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicy | |
| outputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicyMispResult | |
| input: '{ | |
| "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", | |
| "policyId": "$ID:DefinePolicy_WithOut_AllowedAuthTypes_sid_id$", | |
| "requesttime": "$TIMESTAMP$" | |
| }' | |
| output: '{ | |
| "policyGroupStatus": "true", | |
| "policyType": "Auth", | |
| "status": "PUBLISHED", | |
| "is_Active": "true" | |
| }' | |
| Esignet_PublishPolicy_For_Policy_WithOut_AllowedKycAttributes_Smoke: | |
| endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish | |
| uniqueIdentifier: Dependent_Idrepo_createPublishPolicy_12 | |
| description: Publish policy Auth with all valid details | |
| role: partner | |
| restMethod: post | |
| inputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicy | |
| outputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicyMispResult | |
| input: '{ | |
| "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", | |
| "policyId": "$ID:DefinePolicy_WithOut_AllowedKycAttributes_sid_id$", | |
| "requesttime": "$TIMESTAMP$" | |
| }' | |
| output: '{ | |
| "policyGroupStatus": "true", | |
| "policyType": "Auth", | |
| "status": "PUBLISHED", | |
| "is_Active": "true" | |
| }' | |
| Esignet_PublishPolicy_For_Policy_WithOut_FullName_Email_Gender_Smoke: | |
| endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish | |
| uniqueIdentifier: Dependent_Idrepo_createPublishPolicy_13 | |
| description: Publish policy Auth with all valid details | |
| role: partner | |
| restMethod: post | |
| inputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicy | |
| outputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicyMispResult | |
| input: '{ | |
| "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", | |
| "policyId": "$ID:DefinePolicy_WithOut_FullName_Email_Gender_sid_id$", | |
| "requesttime": "$TIMESTAMP$" | |
| }' | |
| output: '{ | |
| "policyGroupStatus": "true", | |
| "policyType": "Auth", | |
| "status": "PUBLISHED", | |
| "is_Active": "true" | |
| }' | |
| Esignet_PublishPolicy_For_Policy_WithOut_AllowedAuthTypes_Smoke: | |
| endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish | |
| uniqueIdentifier: Dependent_Idrepo_createPublishPolicy_11 | |
| description: Publish policy without AllowedAuthTypes | |
| role: partner | |
| restMethod: post | |
| inputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicy | |
| outputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicyMispResult | |
| input: '{ | |
| "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", | |
| "policyId": "$ID:DefinePolicy_WithOut_AllowedAuthTypes_sid_id$", | |
| "requesttime": "$TIMESTAMP$" | |
| }' | |
| output: '{ | |
| "policyGroupStatus": "true", | |
| "policyType": "Auth", | |
| "status": "PUBLISHED", | |
| "is_Active": "true" | |
| }' | |
| Esignet_PublishPolicy_For_Policy_WithOut_AllowedKycAttributes_Smoke: | |
| endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish | |
| uniqueIdentifier: Dependent_Idrepo_createPublishPolicy_12 | |
| description: Publish policy without AllowedKycAttributes | |
| role: partner | |
| restMethod: post | |
| inputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicy | |
| outputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicyMispResult | |
| input: '{ | |
| "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", | |
| "policyId": "$ID:DefinePolicy_WithOut_AllowedKycAttributes_sid_id$", | |
| "requesttime": "$TIMESTAMP$" | |
| }' | |
| output: '{ | |
| "policyGroupStatus": "true", | |
| "policyType": "Auth", | |
| "status": "PUBLISHED", | |
| "is_Active": "true" | |
| }' | |
| Esignet_PublishPolicy_For_Policy_WithOut_FullName_Email_Gender_Smoke: | |
| endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish | |
| uniqueIdentifier: Dependent_Idrepo_createPublishPolicy_13 | |
| description: Publish policy without FullName, Email, and Gender attributes | |
| role: partner | |
| restMethod: post | |
| inputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicy | |
| outputTemplate: esignet/PmsIntegration/PublishPolicy/publishPolicyMispResult | |
| input: '{ | |
| "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", | |
| "policyId": "$ID:DefinePolicy_WithOut_FullName_Email_Gender_sid_id$", | |
| "requesttime": "$TIMESTAMP$" | |
| }' | |
| output: '{ | |
| "policyGroupStatus": "true", | |
| "policyType": "Auth", | |
| "status": "PUBLISHED", | |
| "is_Active": "true" | |
| }' |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@api-test/src/main/resources/esignet/PmsIntegration/PublishPolicy/PublishPolicy.yml`
around lines 206 - 264, The three test cases
Esignet_PublishPolicy_For_Policy_WithOut_AllowedAuthTypes_Smoke,
Esignet_PublishPolicy_For_Policy_WithOut_AllowedKycAttributes_Smoke, and
Esignet_PublishPolicy_For_Policy_WithOut_FullName_Email_Gender_Smoke currently
share a generic description ("Publish policy Auth with all valid details");
update each description to accurately describe the edge case it validates (e.g.,
"Publish policy missing AllowedAuthTypes", "Publish policy missing
AllowedKycAttributes", "Publish policy missing FullName/Email/Gender") so the
description matches the test name and intent.
| Esignet_UploadPartnerCert_For_Credential_Partner_Smoke: | ||
| endPoint: /v1/partnermanager/partners/certificate/upload | ||
| uniqueIdentifier: Dependent_Idrepo_uploadPartnerCert_09 | ||
| description: Upload partner certificate with all valid details | ||
| role: partner | ||
| checkErrorsOnlyInResponse: true | ||
| restMethod: post | ||
| additionalDependencies: Dependent_Idrepo_uploadCACert_01,Dependent_Idrepo_uploadCACert_02 |
There was a problem hiding this comment.
Incorrect additionalDependencies - references wrong CA certificates.
The test case depends on Dependent_Idrepo_uploadCACert_01,Dependent_Idrepo_uploadCACert_02 which correspond to the Auth_Partner's CA certificates (from PartnerSelfRegistration_All_Valid_Smoke_sid).
However, since this test uploads a partner certificate for PartnerSelfRegistration_For_Credential_Partner_sid, it should depend on the Credential Partner's CA certificates defined in UploadCertificate.yml:
Dependent_Idrepo_uploadCACert_17(CA cert)Dependent_Idrepo_uploadSubCACert_18(Intermediate cert)
🐛 Proposed fix
Esignet_UploadPartnerCert_For_Credential_Partner_Smoke:
endPoint: /v1/partnermanager/partners/certificate/upload
uniqueIdentifier: Dependent_Idrepo_uploadPartnerCert_09
description: Upload partner certificate with all valid details
role: partner
checkErrorsOnlyInResponse: true
restMethod: post
- additionalDependencies: Dependent_Idrepo_uploadCACert_01,Dependent_Idrepo_uploadCACert_02
+ additionalDependencies: Dependent_Idrepo_uploadCACert_17,Dependent_Idrepo_uploadSubCACert_18
inputTemplate: esignet/PmsIntegration/UploadCert/uploadCert🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@api-test/src/main/resources/esignet/PmsIntegration/UploadCert/UploadCert.yml`
around lines 146 - 153, The test entry
Esignet_UploadPartnerCert_For_Credential_Partner_Smoke has incorrect
additionalDependencies referencing Dependent_Idrepo_uploadCACert_01 and
Dependent_Idrepo_uploadCACert_02 (Auth_Partner CA certs); update the
additionalDependencies value to use the Credential Partner CA cert identifiers
Dependent_Idrepo_uploadCACert_17 and Dependent_Idrepo_uploadSubCACert_18 so the
test depends on the correct CA and intermediate certs used by
PartnerSelfRegistration_For_Credential_Partner_sid.
Signed-off-by: Sradha Mohanty <mohantysradha10@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@api-test/src/main/resources/esignet/OidcClient/OIDCClient.yml`:
- Around line 722-751: The test case key
Esignet_CreateOIDCClientFAPI_all_Valid_forUserInfoJWE_Smoke_sid is mis-indented
and appears outside the CreateOIDCClient block; fix by re-indenting this entire
mapping so it is nested under the same parent as the other CreateOIDCClient
entries (make the
"Esignet_CreateOIDCClientFAPI_all_Valid_forUserInfoJWE_Smoke_sid:" line and its
following lines have the same indentation level as sibling CreateOIDCClient test
keys), ensuring fields like endPoint, uniqueIdentifier, additionalDependencies,
inputTemplate, outputTemplate and input/output stay correctly aligned beneath
that key. Ensure spacing uses consistent YAML indentation (spaces, not tabs) so
the suite picks up the test and its additionalDependencies as intended.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: d5795964-c982-485d-90d4-0e728ead6ce9
📒 Files selected for processing (2)
api-test/src/main/resources/esignet/OidcClient/OIDCClient.ymlapi-test/testNgXmlFiles/esignetSuite.xml
Signed-off-by: Sradha Mohanty <mohantysradha10@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@api-test/src/main/resources/esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMapping.yml`:
- Around line 62-69: The partnerPolicyMapping scenario currently only lists
additionalDependencies: TC_PMS_createPartnerSelfRegistration_01 but its
policyName is sourced from
$ID:DefinePolicy_WithOut_AllowedKycAttributes_sid_name$; add the corresponding
DefinePolicy producer test to additionalDependencies (e.g., add the appropriate
TC_PMS_definePolicy_* test name) or include it in the centralized
testCaseInterDependency_*.json so the DefinePolicy producer runs before this
consumer, and update the other three mapping scenarios to match this explicit
dependency pattern.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6c3ac5f3-8da0-42be-ae1f-0616751b18e9
📒 Files selected for processing (3)
api-test/src/main/resources/esignet/OidcClient/OIDCClient.ymlapi-test/src/main/resources/esignet/PmsIntegration/ApprovePartnerPolicyMapping/ApproveMappingKey.ymlapi-test/src/main/resources/esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMapping.yml
| additionalDependencies: TC_PMS_createPartnerSelfRegistration_01 | ||
| restMethod: post | ||
| inputTemplate: esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMapping | ||
| outputTemplate: esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMappingResult | ||
| input: '{ | ||
| "partnerId": "$ID:PartnerSelfRegistration_All_Valid_Smoke_sid_partnerId$", | ||
| "policyName": "$ID:DefinePolicy_WithOut_AllowedKycAttributes_sid_name$", | ||
| "useCaseDescription": "Need to submit the payment", |
There was a problem hiding this comment.
Add explicit dependency for DefinePolicy producer tests.
policyName is sourced from $ID:DefinePolicy_*_name$, but this scenario only depends on TC_PMS_createPartnerSelfRegistration_01. Without the DefinePolicy producer dependency, execution becomes order-sensitive and can fail intermittently. Please add the corresponding DefinePolicy test dependency (inline via additionalDependencies or in testCaseInterDependency_*.json) and keep all four mapping scenarios aligned.
Based on learnings: test dependencies in api-test should be explicit (inline additionalDependencies or centralized interdependency JSON) so producer/consumer sequencing is guaranteed.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@api-test/src/main/resources/esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMapping.yml`
around lines 62 - 69, The partnerPolicyMapping scenario currently only lists
additionalDependencies: TC_PMS_createPartnerSelfRegistration_01 but its
policyName is sourced from
$ID:DefinePolicy_WithOut_AllowedKycAttributes_sid_name$; add the corresponding
DefinePolicy producer test to additionalDependencies (e.g., add the appropriate
TC_PMS_definePolicy_* test name) or include it in the centralized
testCaseInterDependency_*.json so the DefinePolicy producer runs before this
consumer, and update the other three mapping scenarios to match this explicit
dependency pattern.
Signed-off-by: Sradha Mohanty <mohantysradha10@gmail.com>
Signed-off-by: Sradha Mohanty <mohantysradha10@gmail.com>
Signed-off-by: Sradha Mohanty <mohantysradha10@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
api-test/testNgXmlFiles/esignetSuite.xml (1)
28-34:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winTypo in test name: "AuditLogVAlidator" should be "AuditLogValidator".
The test name has inconsistent capitalization - "VAlidator" instead of "Validator".
✏️ Proposed fix
- <test name="AuditLogVAlidator"> + <test name="AuditLogValidator">🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@api-test/testNgXmlFiles/esignetSuite.xml` around lines 28 - 34, Fix the typo in the TestNG suite by renaming the test's name attribute from "AuditLogVAlidator" to "AuditLogValidator" in the <test name="..."> entry for the AuditLog yml; update the test declaration so the <test name> value exactly matches "AuditLogValidator" (the class reference io.mosip.testrig.apirig.esignet.testscripts.AuditValidator and the yml parameter remain unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.java`:
- Around line 73-75: Remove the leftover debug print in DBValidator: delete the
conditional block that checks
testCaseDTO.getUniqueIdentifier().contains("TC_Esignet_DBValidator_03") and the
System.out.println("Debug") call; if you need to preserve conditional behavior,
replace it with a proper logger.debug(...) call using the class's logger rather
than System.out, otherwise simply remove the entire if block to avoid noisy test
output.
In `@api-test/src/main/resources/config/esignet.properties`:
- Around line 43-49: The properties file currently hardcodes secrets
(keycloak_Password, audit_password, partner_password, postgres-password); remove
these literal values and replace them with secret references (e.g.,
KEYCLOAK_PASSWORD, AUDIT_DB_PASSWORD, PARTNER_DB_PASSWORD, POSTGRES_PASSWORD)
that are resolved at runtime from a secret store or environment variables;
update the application bootstrap/config loader to fetch those keys from your
chosen secret manager (HashiCorp Vault/AWS Secrets Manager/Kubernetes Secrets)
or process.env and fail fast if missing, and add a note in config docs/example
properties showing placeholder keys only (no real credentials).
- Around line 54-65: This properties file contains hardcoded OAuth client
secrets (e.g., mosip_partner_client_secret, mosip_pms_client_secret,
mosip_resident_client_secret, mosip_idrepo_client_secret,
mosip_reg_client_secret, mosip_admin_client_secret, mosip_hotlist_client_secret,
mosip_regproc_client_secret, mpartner_default_mobile_secret,
mosip_testrig_client_secret, AuthClientSecret, mosip_crvs1_client_secret);
remove these values from the checked-in config and replace them with secure
references (e.g., placeholder keys or empty values) and change the application
config loading to read secrets at runtime from a secrets manager or environment
variables (or a Kubernetes Secret) instead of the properties file; update any
code that directly references these properties to fetch via the chosen secret
provider interface/loader and add deployment/docs notes on how to provision the
required secrets in CI/CD or the target environment.
- Line 109: The VID post-generation delay configured by
vidGenerationProcessingDelayTimeInMilliSeconds (currently 600000) is causing
tests to block because PostWithAutogenIdWithOtpGenerate calls Thread.sleep using
EsignetConfigManager.getproperty; update the value in esignet.properties to
match the QA helm value (90000) or otherwise unify the source of truth so both
deploy/esignet-apitestrig/values.yaml and
api-test/src/main/resources/config/esignet.properties use the same delay, and if
600000 must be kept, add documentation/markup (VID propagation SLA) and/or
adjust PostWithAutogenIdWithOtpGenerate to read a test-specific override to
avoid long sleeps during test runs.
In `@api-test/src/main/resources/esignet/OidcClient/OIDCClient.yml`:
- Line 762: The uniqueIdentifier field duplicates the value
TC_ESignet_CreateOIDCClient_MOSIPID_31 (used elsewhere), causing test
lookup/report collisions; update the duplicate uniqueIdentifier to a new, unique
string (e.g., increment or append a suffix) where the field name is
uniqueIdentifier and ensure it no longer matches
TC_ESignet_CreateOIDCClient_MOSIPID_31 so all testcases (including the one at
the other occurrence) have distinct identifiers.
In `@api-test/testNgXmlFiles/esignetSuite.xml`:
- Line 526: Replace the raw character-data lines "Start of end to end v3 with
mosipId flow test cases" (and the similar plain text nodes found at the other
two locations referenced in the review) with proper XML comments so they become
<!-- Start of end to end v3 with mosipId flow test cases --> (and analogous
comments for the other two strings); locate these text nodes inside the
esignetSuite.xml content and convert them to XML comments to preserve
well-formedness and improve readability.
---
Outside diff comments:
In `@api-test/testNgXmlFiles/esignetSuite.xml`:
- Around line 28-34: Fix the typo in the TestNG suite by renaming the test's
name attribute from "AuditLogVAlidator" to "AuditLogValidator" in the <test
name="..."> entry for the AuditLog yml; update the test declaration so the <test
name> value exactly matches "AuditLogValidator" (the class reference
io.mosip.testrig.apirig.esignet.testscripts.AuditValidator and the yml parameter
remain unchanged).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 16e1fad0-9762-4d32-8100-460712a698b9
📒 Files selected for processing (5)
api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.javaapi-test/src/main/resources/config/esignet.propertiesapi-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.ymlapi-test/src/main/resources/esignet/OidcClient/OIDCClient.ymlapi-test/testNgXmlFiles/esignetSuite.xml
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
api-test/testNgXmlFiles/esignetSuite.xml (1)
28-34:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winTypo in test name: "AuditLogVAlidator" should be "AuditLogValidator".
The test name has inconsistent capitalization - "VAlidator" instead of "Validator".
✏️ Proposed fix
- <test name="AuditLogVAlidator"> + <test name="AuditLogValidator">🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@api-test/testNgXmlFiles/esignetSuite.xml` around lines 28 - 34, Fix the typo in the TestNG suite by renaming the test's name attribute from "AuditLogVAlidator" to "AuditLogValidator" in the <test name="..."> entry for the AuditLog yml; update the test declaration so the <test name> value exactly matches "AuditLogValidator" (the class reference io.mosip.testrig.apirig.esignet.testscripts.AuditValidator and the yml parameter remain unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.java`:
- Around line 73-75: Remove the leftover debug print in DBValidator: delete the
conditional block that checks
testCaseDTO.getUniqueIdentifier().contains("TC_Esignet_DBValidator_03") and the
System.out.println("Debug") call; if you need to preserve conditional behavior,
replace it with a proper logger.debug(...) call using the class's logger rather
than System.out, otherwise simply remove the entire if block to avoid noisy test
output.
In `@api-test/src/main/resources/config/esignet.properties`:
- Around line 43-49: The properties file currently hardcodes secrets
(keycloak_Password, audit_password, partner_password, postgres-password); remove
these literal values and replace them with secret references (e.g.,
KEYCLOAK_PASSWORD, AUDIT_DB_PASSWORD, PARTNER_DB_PASSWORD, POSTGRES_PASSWORD)
that are resolved at runtime from a secret store or environment variables;
update the application bootstrap/config loader to fetch those keys from your
chosen secret manager (HashiCorp Vault/AWS Secrets Manager/Kubernetes Secrets)
or process.env and fail fast if missing, and add a note in config docs/example
properties showing placeholder keys only (no real credentials).
- Around line 54-65: This properties file contains hardcoded OAuth client
secrets (e.g., mosip_partner_client_secret, mosip_pms_client_secret,
mosip_resident_client_secret, mosip_idrepo_client_secret,
mosip_reg_client_secret, mosip_admin_client_secret, mosip_hotlist_client_secret,
mosip_regproc_client_secret, mpartner_default_mobile_secret,
mosip_testrig_client_secret, AuthClientSecret, mosip_crvs1_client_secret);
remove these values from the checked-in config and replace them with secure
references (e.g., placeholder keys or empty values) and change the application
config loading to read secrets at runtime from a secrets manager or environment
variables (or a Kubernetes Secret) instead of the properties file; update any
code that directly references these properties to fetch via the chosen secret
provider interface/loader and add deployment/docs notes on how to provision the
required secrets in CI/CD or the target environment.
- Line 109: The VID post-generation delay configured by
vidGenerationProcessingDelayTimeInMilliSeconds (currently 600000) is causing
tests to block because PostWithAutogenIdWithOtpGenerate calls Thread.sleep using
EsignetConfigManager.getproperty; update the value in esignet.properties to
match the QA helm value (90000) or otherwise unify the source of truth so both
deploy/esignet-apitestrig/values.yaml and
api-test/src/main/resources/config/esignet.properties use the same delay, and if
600000 must be kept, add documentation/markup (VID propagation SLA) and/or
adjust PostWithAutogenIdWithOtpGenerate to read a test-specific override to
avoid long sleeps during test runs.
In `@api-test/src/main/resources/esignet/OidcClient/OIDCClient.yml`:
- Line 762: The uniqueIdentifier field duplicates the value
TC_ESignet_CreateOIDCClient_MOSIPID_31 (used elsewhere), causing test
lookup/report collisions; update the duplicate uniqueIdentifier to a new, unique
string (e.g., increment or append a suffix) where the field name is
uniqueIdentifier and ensure it no longer matches
TC_ESignet_CreateOIDCClient_MOSIPID_31 so all testcases (including the one at
the other occurrence) have distinct identifiers.
In `@api-test/testNgXmlFiles/esignetSuite.xml`:
- Line 526: Replace the raw character-data lines "Start of end to end v3 with
mosipId flow test cases" (and the similar plain text nodes found at the other
two locations referenced in the review) with proper XML comments so they become
<!-- Start of end to end v3 with mosipId flow test cases --> (and analogous
comments for the other two strings); locate these text nodes inside the
esignetSuite.xml content and convert them to XML comments to preserve
well-formedness and improve readability.
---
Outside diff comments:
In `@api-test/testNgXmlFiles/esignetSuite.xml`:
- Around line 28-34: Fix the typo in the TestNG suite by renaming the test's
name attribute from "AuditLogVAlidator" to "AuditLogValidator" in the <test
name="..."> entry for the AuditLog yml; update the test declaration so the <test
name> value exactly matches "AuditLogValidator" (the class reference
io.mosip.testrig.apirig.esignet.testscripts.AuditValidator and the yml parameter
remain unchanged).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 16e1fad0-9762-4d32-8100-460712a698b9
📒 Files selected for processing (5)
api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.javaapi-test/src/main/resources/config/esignet.propertiesapi-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.ymlapi-test/src/main/resources/esignet/OidcClient/OIDCClient.ymlapi-test/testNgXmlFiles/esignetSuite.xml
🛑 Comments failed to post (6)
api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.java (1)
73-75:
⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRemove debug print statement before merge.
This conditional debug output appears to be leftover debugging code. It should be removed before merging to avoid cluttering test output and to maintain code cleanliness.
🧹 Proposed fix
- if(testCaseDTO.getUniqueIdentifier().contains("TC_Esignet_DBValidator_03")) { - System.out.println("Debug"); - }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.java` around lines 73 - 75, Remove the leftover debug print in DBValidator: delete the conditional block that checks testCaseDTO.getUniqueIdentifier().contains("TC_Esignet_DBValidator_03") and the System.out.println("Debug") call; if you need to preserve conditional behavior, replace it with a proper logger.debug(...) call using the class's logger rather than System.out, otherwise simply remove the entire if block to avoid noisy test output.api-test/src/main/resources/config/esignet.properties (3)
43-49:
⚠️ Potential issue | 🔴 Critical | ⚡ Quick winHardcoded passwords violate MOSIP security standards.
Database and Keycloak passwords are hardcoded in the properties file. Per MOSIP guidelines, credentials must never be committed to code or config files.
Migrate these secrets to a secure secret management system (e.g., HashiCorp Vault, AWS Secrets Manager, Kubernetes Secrets) or use environment variables injected at runtime.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@api-test/src/main/resources/config/esignet.properties` around lines 43 - 49, The properties file currently hardcodes secrets (keycloak_Password, audit_password, partner_password, postgres-password); remove these literal values and replace them with secret references (e.g., KEYCLOAK_PASSWORD, AUDIT_DB_PASSWORD, PARTNER_DB_PASSWORD, POSTGRES_PASSWORD) that are resolved at runtime from a secret store or environment variables; update the application bootstrap/config loader to fetch those keys from your chosen secret manager (HashiCorp Vault/AWS Secrets Manager/Kubernetes Secrets) or process.env and fail fast if missing, and add a note in config docs/example properties showing placeholder keys only (no real credentials).Source: Coding guidelines
54-65:
⚠️ Potential issue | 🔴 Critical | ⚡ Quick winHardcoded OAuth client secrets violate MOSIP security standards.
Multiple OAuth client secrets are hardcoded in the properties file. Per MOSIP guidelines, credentials and API keys must never be committed to code or config files.
Migrate these secrets to a secure secret management system (e.g., HashiCorp Vault, AWS Secrets Manager, Kubernetes Secrets) or use environment variables injected at runtime.
🧰 Tools
🪛 Betterleaks (1.3.1)
[high] 56-56: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
[high] 57-57: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
[high] 58-58: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
[high] 59-59: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
[high] 60-60: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
[high] 61-61: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
[high] 62-62: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
[high] 63-63: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@api-test/src/main/resources/config/esignet.properties` around lines 54 - 65, This properties file contains hardcoded OAuth client secrets (e.g., mosip_partner_client_secret, mosip_pms_client_secret, mosip_resident_client_secret, mosip_idrepo_client_secret, mosip_reg_client_secret, mosip_admin_client_secret, mosip_hotlist_client_secret, mosip_regproc_client_secret, mpartner_default_mobile_secret, mosip_testrig_client_secret, AuthClientSecret, mosip_crvs1_client_secret); remove these values from the checked-in config and replace them with secure references (e.g., placeholder keys or empty values) and change the application config loading to read secrets at runtime from a secrets manager or environment variables (or a Kubernetes Secret) instead of the properties file; update any code that directly references these properties to fetch via the chosen secret provider interface/loader and add deployment/docs notes on how to provision the required secrets in CI/CD or the target environment.Sources: Coding guidelines, Linters/SAST tools
109-109:
⚠️ Potential issue | 🟡 Minor🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Description: Search for VID generation timing patterns in test logs or documentation # Look for any documentation or comments about VID timing rg -i "vid.*generation.*delay|vid.*processing.*time" --type-add 'props:*.properties' --type props -C3 # Check if there are any other references to this property rg "vidGenerationProcessingDelayTimeInMilliSeconds" -C3Repository: mosip/esignet
Length of output: 4287
Reduce/align the VID post-generation delay to avoid blocking test runs
api-test/src/main/resources/config/esignet.propertiessetsvidGenerationProcessingDelayTimeInMilliSeconds = 600000(10 minutes), and bothPostWithAutogenIdWithOtpGenerateimplementations callThread.sleep(delayTime)usingEsignetConfigManager.getproperty("vidGenerationProcessingDelayTimeInMilliSeconds"), so this directly blocks test execution after VID generation.
deploy/esignet-apitestrig/values.yamlinstead setsvidGenerationProcessingDelayTimeInMilliSeconds: "90000"(1.5 minutes). Align the config source(s) for QA (or document the VID propagation SLA that requires 600000ms) so tests aren’t unnecessarily slowed.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@api-test/src/main/resources/config/esignet.properties` at line 109, The VID post-generation delay configured by vidGenerationProcessingDelayTimeInMilliSeconds (currently 600000) is causing tests to block because PostWithAutogenIdWithOtpGenerate calls Thread.sleep using EsignetConfigManager.getproperty; update the value in esignet.properties to match the QA helm value (90000) or otherwise unify the source of truth so both deploy/esignet-apitestrig/values.yaml and api-test/src/main/resources/config/esignet.properties use the same delay, and if 600000 must be kept, add documentation/markup (VID propagation SLA) and/or adjust PostWithAutogenIdWithOtpGenerate to read a test-specific override to avoid long sleeps during test runs.api-test/src/main/resources/esignet/OidcClient/OIDCClient.yml (1)
762-762:
⚠️ Potential issue | 🟠 Major | ⚡ Quick winDuplicate
uniqueIdentifiervalue conflicts with another testcase.
TC_ESignet_CreateOIDCClient_MOSIPID_31is reused here and again at Line 792, which can cause testcase lookup/reporting collisions in the test harness.✏️ Proposed fix
- uniqueIdentifier: TC_ESignet_CreateOIDCClient_MOSIPID_31 + uniqueIdentifier: TC_ESignet_CreateOIDCClient_MOSIPID_39📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.uniqueIdentifier: TC_ESignet_CreateOIDCClient_MOSIPID_39🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@api-test/src/main/resources/esignet/OidcClient/OIDCClient.yml` at line 762, The uniqueIdentifier field duplicates the value TC_ESignet_CreateOIDCClient_MOSIPID_31 (used elsewhere), causing test lookup/report collisions; update the duplicate uniqueIdentifier to a new, unique string (e.g., increment or append a suffix) where the field name is uniqueIdentifier and ensure it no longer matches TC_ESignet_CreateOIDCClient_MOSIPID_31 so all testcases (including the one at the other occurrence) have distinct identifiers.api-test/testNgXmlFiles/esignetSuite.xml (1)
526-526: 🧹 Nitpick | 🔵 Trivial
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Verify if the XML is valid xmllint --noout api-test/testNgXmlFiles/esignetSuite.xml 2>&1 || echo "XML validation failed"Repository: mosip/esignet
Length of output: 125
Treat the “Start/End … flow test cases” lines as plain XML text (not a parsing failure), optionally convert them to comments for consistency
The lines at 526, 579, and 581 are character data nodes (not<!-- ... -->), but the suite file remains well-formed XML. Converting them to XML comments would improve consistency/readability.🐛 Proposed fix
- Start of end to end v3 with mosipId flow test cases + <!-- Start of end to end v3 with mosipId flow test cases -->- End of end to end v3 with mosipId flow test cases + <!-- End of end to end v3 with mosipId flow test cases -->- Start of end to end v3 with mock flow test cases + <!-- Start of end to end v3 with mock flow test cases -->🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@api-test/testNgXmlFiles/esignetSuite.xml` at line 526, Replace the raw character-data lines "Start of end to end v3 with mosipId flow test cases" (and the similar plain text nodes found at the other two locations referenced in the review) with proper XML comments so they become <!-- Start of end to end v3 with mosipId flow test cases --> (and analogous comments for the other two strings); locate these text nodes inside the esignetSuite.xml content and convert them to XML comments to preserve well-formedness and improve readability.
MOSIP-44864: Automated ESIGNET Testcases For OIDC Client.
Summary by CodeRabbit
Tests
Chores