Merged
Conversation
- Introduced `.github/workflows/maven.yml` for Java CI with Maven, enabling automated build and test runs. - Added `CreateUserServiceTest` to validate user creation flow with encrypted passwords and unique email checks. - Updated `ZaldoApiApplicationTests` to disable until test database configuration is finalized. - Upgraded `actions/checkout` version in `docker-image.yml` workflow for improved compatibility. Signed-off-by: Willian Silva <williansilva@alu.ufc.br>
- Migrated `CreateUserServiceTest` to use package-private access for consistency with new tests. - Added `FindUserByTelegramIdServiceTest` to validate user retrieval by Telegram ID. - Added `FindUserByIdServiceTest` to test user retrieval logic by ID. - Added `DeleteUserByIdServiceTest` to verify user deletion scenarios. - Added `UpdateUserServiceTest` to validate user updates, including email uniqueness, password encoding, and exception handling. - Added `ListUsersServiceTest` to test user listing with and without filters. Signed-off-by: Willian Silva <williansilva@alu.ufc.br>
There was a problem hiding this comment.
Pull request overview
Adds unit-level coverage for the user service layer (CRUD + list/find operations) and introduces/updates GitHub Actions workflows to run the Maven test suite and build Docker images.
Changes:
- Added Mockito-based unit tests for Create/List/Find/Update/Delete user services.
- Disabled the default Spring Boot context-load test pending test DB configuration.
- Added a Maven CI workflow and updated the Docker workflow checkout action version.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| zaldo-api/src/test/java/br/com/github/williiansilva51/zaldo/application/service/user/CreateUserServiceTest.java | New unit tests for user creation and email uniqueness behavior. |
| zaldo-api/src/test/java/br/com/github/williiansilva51/zaldo/application/service/user/DeleteUserByIdServiceTest.java | New unit tests for user deletion success/failure paths. |
| zaldo-api/src/test/java/br/com/github/williiansilva51/zaldo/application/service/user/FindUserByIdServiceTest.java | New unit tests for lookup-by-id and not-found exception. |
| zaldo-api/src/test/java/br/com/github/williiansilva51/zaldo/application/service/user/FindUserByTelegramIdServiceTest.java | New unit tests for lookup-by-telegram-id optional behavior. |
| zaldo-api/src/test/java/br/com/github/williiansilva51/zaldo/application/service/user/ListUsersServiceTest.java | New unit tests for list-all vs filtered listing. |
| zaldo-api/src/test/java/br/com/github/williiansilva51/zaldo/application/service/user/UpdateUserServiceTest.java | New unit tests for update flows, validation, and password handling. |
| zaldo-api/src/test/java/br/com/github/williiansilva51/zaldo/ZaldoApiApplicationTests.java | Disabled the default Spring Boot test class. |
| .github/workflows/maven.yml | New workflow to run Maven tests on push/PR to main. |
| .github/workflows/docker-image.yml | Updated checkout action version in Docker build workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces comprehensive unit tests for the user-related service layer in the application, ensuring robust coverage for user creation, retrieval, update, deletion, and listing. It also improves CI/CD reliability by updating GitHub Actions workflows. The most important changes are outlined below:
User Service Unit Test Coverage:
Added
CreateUserServiceTest,DeleteUserByIdServiceTest,FindUserByIdServiceTest,FindUserByTelegramIdServiceTest,ListUsersServiceTest, andUpdateUserServiceTestto rigorously test all main user service operations, including success and failure scenarios, exception handling, and edge cases. [1] [2] [3] [4] [5] [6]Disabled the default Spring Boot test (
ZaldoApiApplicationTests) until the test database is properly configured, preventing false negatives in the test suite.CI/CD Workflow Improvements:
Added a new
.github/workflows/maven.ymlworkflow to automate building and testing Java code with Maven on pushes and pull requests to themainbranch, using JDK 25.Updated the Docker image workflow to use
actions/checkout@v6for improved security and reliability.