-
Notifications
You must be signed in to change notification settings - Fork 29
Add missing unit tests for UserService and AuthService #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive unit tests for the UserService and AuthService classes to improve test coverage of the service layer. The tests use JUnit 5 and Mockito for isolated, fast testing without external dependencies.
Changes:
- Added UserServiceTest with 7 test cases covering user registration, username validation, user listing, and password changes
- Added AuthServiceTest with 3 test cases covering login success and failure scenarios
- All tests follow existing project patterns and use proper mocking with MockitoExtension
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| backend/src/test/java/vaultWeb/services/auth/AuthServiceTest.java | Adds unit tests for AuthService login functionality with success and failure cases |
| backend/src/test/java/vaultWeb/services/UserServiceTest.java | Adds comprehensive unit tests for UserService covering registration, username checks, user listing, and password management |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backend/src/test/java/vaultWeb/services/auth/AuthServiceTest.java
Outdated
Show resolved
Hide resolved
|
@DenizAltunkapan whenever you have time, could you please take a look at this PR? Thank you. For clarity: user roles in the current codebase are applied at the group/member domain level and not within the UserService or AuthService logic. This PR focuses on unit testing the user lifecycle and authentication flow, which aligns with the scope of Issue #109. |
|
@vizahat36 please format your code using spotless |
|
@DenizAltunkapan |
|
@vizahat36 Thank you for your contribution. I changed the keyword from “fixes” to “related to” so the issue stays open and others can open follow-up PRs for testing purposes. |
Related to #109
This PR adds missing unit tests for the User Management service layer.
What was added:
Notes:
Test verification: