Skip to content

MOSIP-44864: Automated ESIGNET Testcases For OIDC Client.#1703

Open
SradhaMohanty5899 wants to merge 3 commits into
mosip:developfrom
SradhaMohanty5899:MOSIP-44709
Open

MOSIP-44864: Automated ESIGNET Testcases For OIDC Client.#1703
SradhaMohanty5899 wants to merge 3 commits into
mosip:developfrom
SradhaMohanty5899:MOSIP-44709

Conversation

@SradhaMohanty5899
Copy link
Copy Markdown
Contributor

@SradhaMohanty5899 SradhaMohanty5899 commented Apr 15, 2026

MOSIP-44864: Automated ESIGNET Testcases For OIDC Client.

Summary by CodeRabbit

Release Notes

  • Tests
    • Added audit log validation capabilities for comprehensive logging verification.
    • Introduced database validation testing for data consistency checks.
    • Added test coverage for partner policy mapping and approval workflows.
    • Expanded test scenarios for OIDC client creation with enhanced policy validation.
    • Added test scenarios for data share policy management and credential partner operations.
    • Enhanced test coverage for certificate upload workflows.

Signed-off-by: Sradha Mohanty <mohantysradha10@gmail.com>
Signed-off-by: Sradha Mohanty <mohantysradha10@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

Walkthrough

This PR introduces audit log and database validation test infrastructure for eSignet, adding two new TestNG test classes and expanding test coverage with 25+ new test scenarios across OIDC client management, partner policies, certificate uploads, and policy definitions. Supporting Handlebars templates and YAML configurations define request/response payloads and test execution parameters.

Changes

Cohort / File(s) Summary
Test Validator Classes
api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/AuditValidator.java, DBValidator.java
New TestNG test classes implementing audit log and database validation. Both execute per test case, validate execution eligibility, execute SQL queries via DBManager, construct output validation maps, and publish results. AuditValidator queries audit logs by module and username; DBValidator executes SQL against specified schemas/tables with JSON payload filtering.
Audit Log Test Resources
api-test/src/main/resources/esignet/AuditLog/AuditLog.yml, AuditLogResult.hbs, auditlog.hbs
Audit log test definition and templates. Single smoke test case validates audit log query execution with empty input and output containing module_name and cr_by fields.
Database Validator Test Resources
api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.yml, DBValidatorTest.hbs, DBValidatorTestResult.hbs
Database validation test definitions targeting three different database schemas/tables (pms.oidc_client, esignet.client_detail, ida.oidc_client_data) with parameterized client ID injections and empty result templates.
OIDC Client Management
api-test/src/main/resources/esignet/OidcClient/OIDCClient.yml, OIDCClient2.hbs
Expanded OIDC client test coverage with 8 new test cases covering DataShare policy validation, MISP policy rejection, approval states, and policy attribute combinations. New template supports multiple redirect URIs and grant types.
Partner Policy Mapping
api-test/src/main/resources/esignet/PmsIntegration/PartnerPolicyMapping/*, api-test/src/main/resources/esignet/PmsIntegration/ApprovePartnerPolicyMapping/*
Partner policy mapping workflow tests with three scenarios validating policy associations for different KYC attribute configurations. Approval test case targets PUT endpoint with mappingkey path parameter.
Policy Management
api-test/src/main/resources/esignet/PmsIntegration/DefinePolicy/DefinePolicy.yml, definePolicy2.hbs, definePolicy3.hbs, definePolicy4.hbs, defineDataSharePolicy.hbs, DefinePolicyGroup/DefinePolicyGroup.yml
Policy definition and grouping tests covering DataShare and Auth policy types with varying KYC attributes and authentication methods. Multiple policy templates define allowed attributes, auth types, biometric sources, and data-share configurations.
Publish Policy
api-test/src/main/resources/esignet/PmsIntegration/PublishPolicy/PublishPolicy.yml
Five new publish policy scenarios validating DataShare and Auth policy publication with attribute/auth type variations.
Certificate Upload
api-test/src/main/resources/esignet/PmsIntegration/UploadCert/UploadCert.yml, UploadCertificate/UploadCertificate.yml
Certificate upload test cases for credential partners including CA and intermediate certificates with expected success responses.
Partner Self-Registration
api-test/src/main/resources/esignet/PmsIntegration/CreatePartner/CreatePartner.yml
New credential partner self-registration test case injecting partner email and random partner ID variables.
PostWithBodyAndPathParams Enhancement
api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithBodyAndPathParams.java
Extended to support idKeyName parameter for auto-generated ID extraction and persistence when test case name contains "_sid" substring.
TestNG Suite Configuration
api-test/testNgXmlFiles/esignetSuite.xml, esignetPrerequisiteSuite.xml
Added four new TestNG test declarations: DBValidator and AuditLogValidator in main suite, partnerPolicyMapping and ApprovePartnerPolicyMapping in prerequisite suite with appropriate YAML file and path parameter mappings.

Sequence Diagram(s)

sequenceDiagram
    participant Test as Test Class
    participant HC as HealthChecker
    participant DBM as DBManager
    participant OVU as OutputValidationUtil

    Test->>HC: signalTerminateExecution check
    alt Execution Halted
        Test->>Test: throw SkipException
    else Execution Continues
        Test->>Test: Build SQL query
        Test->>DBM: executeQueryAndGetRecord(role, query)
        DBM-->>Test: responseRecordMap
        alt Records Found
            Test->>Test: status = "PASS"
        else No Records
            Test->>Test: status = "FAIL"
        end
        Test->>OVU: publishOutputResult(validationMap)
        OVU-->>Test: success/failure
        alt Publication Failed
            Test->>Test: throw AdminTestException
        end
    end
Loading
sequenceDiagram
    participant Test as Test Class
    participant Template as TemplateEngine
    participant DBM as DBManager
    participant OVU as OutputValidationUtil

    Test->>Template: getJsonFromTemplate(payload)
    Template-->>Test: inputJson
    Test->>Test: inputJsonKeyWordHandler(inputJson)
    Test->>Test: Extract filter key from JSON
    Test->>Test: Build SQL query + filter value
    Test->>DBM: executeQueryAndGetRecord(role, query)
    DBM-->>Test: responseRecordMap
    alt Records Returned
        Test->>Test: status = "PASS"
    else Empty Response
        Test->>Test: status = "FAIL"
    end
    Test->>OVU: publishOutputResult(validationMap)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 Hop along, dear developers, with audits and queries so bright,
New validators are hopping through DBs both day and night!
From policies to certificates, the tests multiply with glee,
eSignet now hops with certainty—a validation symphony! ✨🐇

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly addresses the main objective of adding automated test cases for OIDC Client functionality in ESIGNET, which aligns with the majority of changes including new test classes, YAML configurations, and templates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

🧹 Nitpick comments (9)
api-test/src/main/resources/esignet/OidcClient/OIDCClient2.hbs (1)

9-14: grantTypes and clientAuthMethods support 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 to redirectUris if 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, the templateFields (static List) and response (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 adding prerequisite parameter for consistency.

The new partnerPolicyMapping and ApprovePartnerPolicyMapping tests 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_userName value 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) and response (Response type) are declared but never used. The response field shadows the local Map<String, Object> response variable 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: templateFields from DTO is fetched but not used.

The templateFields array is retrieved from testCaseDTO and 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

📥 Commits

Reviewing files that changed from the base of the PR and between 8b88f70 and d911545.

📒 Files selected for processing (29)
  • api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/AuditValidator.java
  • api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/DBValidator.java
  • api-test/src/main/java/io/mosip/testrig/apirig/esignet/testscripts/PostWithBodyAndPathParams.java
  • api-test/src/main/resources/esignet/AuditLog/AuditLog.yml
  • api-test/src/main/resources/esignet/AuditLog/AuditLogResult.hbs
  • api-test/src/main/resources/esignet/AuditLog/auditlog.hbs
  • api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.hbs
  • api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTest.yml
  • api-test/src/main/resources/esignet/DBValidatorAndAuditValidator/DBValidatorTestResult.hbs
  • api-test/src/main/resources/esignet/OidcClient/OIDCClient.yml
  • api-test/src/main/resources/esignet/OidcClient/OIDCClient2.hbs
  • api-test/src/main/resources/esignet/PmsIntegration/ApprovePartnerPolicyMapping/ApproveMappingKey.yml
  • api-test/src/main/resources/esignet/PmsIntegration/ApprovePartnerPolicyMapping/approveMappingKey.hbs
  • api-test/src/main/resources/esignet/PmsIntegration/ApprovePartnerPolicyMapping/approveMappingKeyResult.hbs
  • api-test/src/main/resources/esignet/PmsIntegration/CreatePartner/CreatePartner.yml
  • api-test/src/main/resources/esignet/PmsIntegration/DefinePolicy/DefinePolicy.yml
  • api-test/src/main/resources/esignet/PmsIntegration/DefinePolicy/defineDataSharePolicy.hbs
  • api-test/src/main/resources/esignet/PmsIntegration/DefinePolicy/definePolicy2.hbs
  • api-test/src/main/resources/esignet/PmsIntegration/DefinePolicy/definePolicy3.hbs
  • api-test/src/main/resources/esignet/PmsIntegration/DefinePolicy/definePolicy4.hbs
  • api-test/src/main/resources/esignet/PmsIntegration/DefinePolicyGroup/DefinePolicyGroup.yml
  • api-test/src/main/resources/esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMapping.hbs
  • api-test/src/main/resources/esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMapping.yml
  • api-test/src/main/resources/esignet/PmsIntegration/PartnerPolicyMapping/partnerPolicyMappingResult.hbs
  • api-test/src/main/resources/esignet/PmsIntegration/PublishPolicy/PublishPolicy.yml
  • api-test/src/main/resources/esignet/PmsIntegration/UploadCert/UploadCert.yml
  • api-test/src/main/resources/esignet/PmsIntegration/UploadCertificate/UploadCertificate.yml
  • api-test/testNgXmlFiles/esignetPrerequisiteSuite.xml
  • api-test/testNgXmlFiles/esignetSuite.xml

Comment on lines +83 to +91
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) + "'";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Comment on lines +13 to +16
output: '{
"module_name": "esignet-service"
"cr_by": "111997"
}' No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix invalid JSON in expected output.

Line 14 and Line 15 are missing a comma, so this expected payload is not valid JSON.

💡 Suggested fix
     output: '{
-      "module_name": "esignet-service"
+      "module_name": "esignet-service",
       "cr_by": "111997"
    }'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-test/src/main/resources/esignet/AuditLog/AuditLog.yml` around lines 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.

Comment on lines +2 to +42
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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
done

Repository: 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.json

Repository: 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.json

Repository: 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 2

Repository: 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 -20

Repository: 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 -40

Repository: 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.

"status": "ACTIVE"
}' No newline at end of file
}'
Esignet_CreateOIDCClient_With_DataSharePlocy_Neg:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typo in test case name: "DataSharePlocy" should be "DataSharePolicy".

✏️ Proposed fix
-   Esignet_CreateOIDCClient_With_DataSharePlocy_Neg:
+   Esignet_CreateOIDCClient_With_DataSharePolicy_Neg:
📝 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.

Suggested change
Esignet_CreateOIDCClient_With_DataSharePlocy_Neg:
Esignet_CreateOIDCClient_With_DataSharePolicy_Neg:
🤖 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` at 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.

Comment on lines +778 to +782
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
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.

"authPartnerId": "$ID:PartnerSelfRegistration_All_Valid_Smoke_sid_partnerId$",
"logoUri": "https://health-services.com/logo.png",
"redirectUris": "$IDPREDIRECTURI$",
"grantTypes": "authorization_code",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Line contains excessive trailing whitespace.

Line 882 has a very long string of trailing whitespace characters after "authorization_code". This should be cleaned up.

🤖 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` at 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.

Comment on lines +2 to +15
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$"
}'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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.

Comment on lines +206 to 264
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
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.

Comment on lines +146 to +153
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant