Skip to content

test: improve JwtService test coverage with additional test cases.#1151

Open
RomanoHeur wants to merge 2 commits into
viru0909-dev:mainfrom
RomanoHeur:feat/improve-jwt-service-unit-test
Open

test: improve JwtService test coverage with additional test cases.#1151
RomanoHeur wants to merge 2 commits into
viru0909-dev:mainfrom
RomanoHeur:feat/improve-jwt-service-unit-test

Conversation

@RomanoHeur

@RomanoHeur RomanoHeur commented Jun 4, 2026

Copy link
Copy Markdown

…ests

Pull Request

Description

This PR improves the test coverage of the JwtService class by adding additional unit tests and improving existing ones.
Closes #867

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@RomanoHeur RomanoHeur requested a review from viru0909-dev as a code owner June 4, 2026 15:32
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

@RomanoHeur is attempting to deploy a commit to the CodeBlooded's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Hi @RomanoHeur, thanks for contributing to Nyay Setu! 🎉

I have automatically:

  • 👤 Assigned this PR to you.
  • 🏷️ Applied the gssoc:approved label.

Our workflows will now analyze your changes to classify:

  • 📈 PR Difficulty: level:*
  • 🧩 PR Type: type:*
  • 🌟 PR Quality: quality:*

Tip

Ensure your PR description references the issue it resolves (e.g. Closes #123). This allows the bot to inherit any additional labels from that issue!

Happy coding! 🚀

@viru0909-dev viru0909-dev left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Requires Changes. Please address the following issues:

  • Title is not following the conventional commits format (e.g. 'feat: ...', 'fix: ...').

@RomanoHeur RomanoHeur changed the title Improve JwtService unit test coverage and added new additional unit tests test: improve JwtService test coverage with additional test cases. Jun 9, 2026
@RomanoHeur

Copy link
Copy Markdown
Author

@viru0909-dev Thanks for your reply. I have updated the PR title to the conventional commit format.

@viru0909-dev viru0909-dev left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Review Summary

This PR has been reviewed and requires changes before it can be approved. The issues below must be resolved.

Issues to Resolve

Result Check Notes
FAIL Checklist 4 checklist item(s) are still unchecked. Complete all items before submitting for review.
FAIL Code Quality 1 critical code issue(s) and 0 warning(s) found in the diff. Critical issues must be resolved before this PR can be approved.

Passing Checks

Result Check Notes
PASS Title Title format is acceptable.
PASS Description Description is complete and well-structured.
PASS Issue Link Issue is linked with a closing keyword.
PASS Merge Conflicts Conflict status is not yet computed by GitHub — skipping.
PASS Branch Freshness Branch was last updated 2.5 days ago.
PASS CI / Tests No CI checks are configured or results are not yet available.

Code Review — Line-by-Line Findings

[ERROR] backend/nyaysetu-backend/src/test/java/com/nyaysetu/backend/service/JwtServiceTest.java — line 59

String malformedToken = "this.is.not.a.valid.jwt";
Possible hardcoded credential or secret detected.

[INFO] backend/nyaysetu-backend/src/test/java/com/nyaysetu/backend/service/JwtServiceTest.java — line 99

.setExpiration(new Date(System.currentTimeMillis() + 60000))
Large magic number detected — consider a named constant.


To proceed: push the required fixes to feat/improve-jwt-service-unit-test and the PR will be re-evaluated on the next review run.

@RomanoHeur

Copy link
Copy Markdown
Author

@viru0909-dev Thanks for the review. I've addressed all the changes:

  • Removed the flagged hardcoded token patterns.
  • Replaced magic numbers with named constants
  • Updated the pull request description and checklist fomatting

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Testing] Improve test coverage for JwtService

2 participants