Skip to content
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

Add PetValidator unit and integration tests #1714

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

wickdynex
Copy link
Contributor

Title:

Add PetValidator unit and integration tests


Description:

This PR add PetValidatorTests to test whether the class PetValidator works as expected. Tests including unit and integration tests.


Problem:

The project is lack of a unit test for PetValidator class. Without proper testing, the validator’s functionality may go unverified


Solution:

  • Add new test: add test file to check each methods of PetValidate.

Type of Change

  • New feature

Changes:

  • Add test class named PetValidatorTests to check PetValidator work.

Local Test ScreenShot:

image

Additional Information:

If there are any bad design patterns, design approaches, or bugs in this PR😵‍💫, please point them out, and I will make the necessary changes🥰.

Followed Question:

  1. Need I update the Copyright year at the top of each I've modified files?
  2. Need I refactor the Validate process, use Spring Bean Validation instead of PetValidation class?
    plz give some idea🤩.

-<modify>: remove `@Transactional`.
-<add>: create unit-test file related to `PetValidator`.
-<refactor>: move pet objects initialization to `@BeforeEach` setup.
@wickdynex wickdynex force-pushed the test/add-pet-validator-tests branch from 63b9e44 to 26bac39 Compare November 12, 2024 10:51
@dsyer dsyer merged commit 40a4137 into spring-projects:main Nov 28, 2024
3 checks passed
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.

2 participants