Skip to content

MOSIP-45312 - Automated esignet test cases - #2292

Merged
zesu22 merged 2 commits into
mosip:developfrom
prathmeshj12:develop
Aug 3, 2026
Merged

zesu22 merged 2 commits into
mosip:developfrom
prathmeshj12:develop

Conversation

@prathmeshj12

@prathmeshj12 prathmeshj12 commented Aug 2, 2026 •

Copy link
Copy Markdown
Collaborator

MOSIP-45312 - Automated esignet test cases

Summary by CodeRabbit

  • New Features

    • Added coverage for OAuth details requests involving non-FAPI clients under the FAPI 2.0 profile.
    • Added support for testing non-FAPI client signing keys.
    • Added validation for invalid evidence document types in verified claims.
  • Bug Fixes

    • Tests now skip FAPI-specific scenarios when FAPI 2.0 is not enabled.
  • Tests

    • Added negative test coverage for expected invalid_request and invalid_claim responses.
    • Added test dependencies for scope, language, and claims scenarios.

Signed-off-by: prathmeshj12 <prathmesh.j@cyberpwn.com>
@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@prathmeshj12, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 62c949a9-6cac-456e-a489-7db49fcecd0b

📥 Commits

Reviewing files that changed from the base of the PR and between 2964744 and c58b4d9.

📒 Files selected for processing (1)
  • api-test/src/main/resources/esignet/DifferentScopeLanguageClaimsSce/OAuthDetails/OAuthDetailsVerifiedClaimsInvalidEvidenceType.hbs

Walkthrough

The API tests now support a cached JWK for non-FAPI clients, skip an incompatible test outside FAPI 2.0, and cover invalid OAuth-details requests for non-FAPI clients and verified claims.

Changes

OAuth negative test coverage

Layer / File(s) Summary
Non-FAPI-client JWK and profile handling
api-test/src/main/java/.../EsignetUtil.java
Adds JWK generation, caching, accessors, and FAPI 2.0 profile gating for the negative test.
FAPI non-FAPI-client OAuth test
api-test/src/main/resources/esignet/FAPI/...
Creates a client with PAR, DPoP, and PKCE disabled, then expects invalid_request from the OAuth-details endpoint.
Invalid verified-claims evidence test
api-test/src/main/resources/esignet/DifferentScopeLanguageClaimsSce/..., api-test/src/main/resources/config/testCaseInterDependency_mock.json
Adds a request with an invalid evidence type and expects invalid_claim, with its client dependency configured.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant TestRunner
  participant EsignetUtil
  participant eSignetServer
  TestRunner->>EsignetUtil: Expand non-FAPI-client JWK
  EsignetUtil->>EsignetUtil: Generate or reuse cached JWK
  TestRunner->>eSignetServer: Submit OAuth-details request
  eSignetServer-->>TestRunner: Return invalid_request
Loading

Possibly related PRs

Suggested reviewers: mohanachandran-s, zesu22

Poem

A cached JWK supports the test flow,
FAPI gates the cases it should show.
Invalid claims and requests align,
Expected errors mark the line.
Test paths now follow the design.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the MOSIP issue and the primary change: adding automated eSignet test cases.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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/DifferentScopeLanguageClaimsSce/OAuthDetails/OAuthDetailsVerifiedClaimsInvalidEvidenceType.hbs`:
- Around line 38-41: Ensure the test case 28 template context supplies the
required uiLocales value: either remove the uiLocales placeholder from
OAuthDetailsVerifiedClaimsInvalidEvidenceType.hbs if the scenario does not need
it, or add the corresponding uiLocales input in OAuthDetailsRequest.yml. Update
both affected files as needed so rendering reaches the invalid evidence type
validation.

In
`@api-test/src/main/resources/esignet/FAPI/FAPICreateOIDCClientV3/FAPICreateOIDCClient.yml`:
- Around line 51-78: Close both embedded JSON scalars by adding the missing
closing characters after "require_pkce": false in
FAPICreateOIDCClientV3/FAPICreateOIDCClient.yml#L51-L78 and after the errors
array in FAPIOauthDetailsNegTC/FAPIOauthDetailsNegTC.yml#L44-L49, so both YAML
fixtures parse successfully.
🪄 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 Plus

Run ID: 81db5b19-5ace-40ed-8e61-a259d36baf9b

📥 Commits

Reviewing files that changed from the base of the PR and between b1fe07e and 6cb589e.

📒 Files selected for processing (6)
  • api-test/src/main/java/io/mosip/testrig/apirig/esignet/utils/EsignetUtil.java
  • api-test/src/main/resources/config/testCaseInterDependency_mock.json
  • api-test/src/main/resources/esignet/DifferentScopeLanguageClaimsSce/OAuthDetails/OAuthDetailsRequest.yml
  • api-test/src/main/resources/esignet/DifferentScopeLanguageClaimsSce/OAuthDetails/OAuthDetailsVerifiedClaimsInvalidEvidenceType.hbs
  • api-test/src/main/resources/esignet/FAPI/FAPICreateOIDCClientV3/FAPICreateOIDCClient.yml
  • api-test/src/main/resources/esignet/FAPI/FAPIOauthDetailsNegTC/FAPIOauthDetailsNegTC.yml

CodeRabbit review on PR #2292: OAuthDetailsVerifiedClaimsInvalidEvidenceType.hbs
referenced {{uiLocales}} but no test case supplies it, and no other test in this
YAML file uses uiLocales either.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: prathmeshj12 <prathmesh.j@cyberpwn.com>

@zesu22 zesu22 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving because @mohanachandran-s has already approved it

@zesu22
zesu22 merged commit 1569bf2 into mosip:develop Aug 3, 2026
29 checks passed
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.

4 participants