Skip to content

Feat/first tests#19

Merged
WillianSilva51 merged 3 commits intomainfrom
feat/first-tests
Feb 18, 2026
Merged

Feat/first tests#19
WillianSilva51 merged 3 commits intomainfrom
feat/first-tests

Conversation

@WillianSilva51
Copy link
Copy Markdown
Owner

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, and UpdateUserServiceTest to 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.yml workflow to automate building and testing Java code with Maven on pushes and pull requests to the main branch, using JDK 25.

  • Updated the Docker image workflow to use actions/checkout@v6 for improved security and reliability.

- 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>
@WillianSilva51 WillianSilva51 self-assigned this Feb 18, 2026
Copilot AI review requested due to automatic review settings February 18, 2026 00:06
@WillianSilva51 WillianSilva51 added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 18, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread .github/workflows/maven.yml
Comment thread .github/workflows/maven.yml
@WillianSilva51 WillianSilva51 merged commit f33deb6 into main Feb 18, 2026
1 check passed
@WillianSilva51 WillianSilva51 deleted the feat/first-tests branch February 18, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants