Skip to content

Testes unitarios#130

Merged
clivissonjose merged 5 commits into
grupo-RGNVHC:mainfrom
clivissonjose:main
Sep 9, 2025
Merged

Testes unitarios#130
clivissonjose merged 5 commits into
grupo-RGNVHC:mainfrom
clivissonjose:main

Conversation

@clivissonjose

Copy link
Copy Markdown
Contributor

This pull request introduces several improvements to the backend test coverage, updates some configuration and repository annotations, and makes minor corrections to test data for consistency. The most significant changes are the addition of comprehensive unit tests for the CompanyController and VacancyService, which help ensure reliability of core business logic. Additionally, the database configuration and repository annotations have been updated for better clarity and alignment with Spring standards.

Test Coverage Improvements:

  • Added a full suite of unit tests for CompanyController, covering create, delete, update, and find operations, including exception scenarios. (backend/src/test/java/com/va2es/backend/company/controller/CompanyControllerTest.java)
  • Added new unit tests for VacancyService, including scenarios for vacancy creation and deletion, with proper exception handling when entities are not found. (backend/src/test/java/com/va2es/backend/vacancy/service/VacancyServiceTest.java)
  • Added a stub test class for VacancyController to prepare for future tests. (backend/src/test/java/com/va2es/backend/vacancy/Controller/VacancyControllerTest.java)

Configuration and Annotation Updates:

  • Changed database name and password in application.properties to match the backend environment, improving developer onboarding and reducing configuration errors. (backend/src/main/resources/application.properties)
  • Added the @Repository annotation to CompanyRepository for better Spring integration and clarity. (backend/src/main/java/com/va2es/backend/repositories/CompanyRepository.java)

Test Data Corrections:

  • Updated phone number fields in various student service tests to use consistent formatting, ensuring realistic and valid test data. (backend/src/test/java/com/va2es/backend/student/service/StudentServiceTest.java) [1] [2] [3] [4] [5] [6]
  • Updated email in one test case to avoid duplication and ensure test isolation. (backend/src/test/java/com/va2es/backend/student/service/StudentServiceTest.java)

Minor Cleanups:

  • Removed an unused import from CompanyServiceTest for code cleanliness. (backend/src/test/java/com/va2es/backend/company/service/CompanyServiceTest.java)

@clivissonjose clivissonjose merged commit 88ec326 into grupo-RGNVHC:main Sep 9, 2025
1 check failed
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.

1 participant