Skip to content

Conversation

@Jagdish-Singh-Bisht
Copy link

Description of what I changed

Added a new unit test to ensure ValidateUtil.validate() exposes the correct validation error message/code when validation fails.

Specifically, I added a test in ValidateUtilTest that:

  • Creates an invalid Location object (missing required name)
  • Calls ValidateUtil.validate()
  • Asserts that a ValidationException is thrown
  • Asserts that the underlying Errors object has a field error on "name"
  • Verifies that the error code is "error.name"

This improves test coverage for TRUNK-4860, ensuring validators are checked not only for failures but also for correct error messages.

Issue I worked on:

see https://issues.openmrs.org/browse/TRUNK-4860

Checklist: I completed these to help reviewers :

  • My IDE is configured to follow the code style
    of this project.
  • I have added tests to cover my changes.
  • I ran mvn clean package right before creating this pull request and added all formatting changes to my commit.
  • All new and existing tests passed.
  • My pull request is based on the latest changes of the master branch.

@Jagdish-Singh-Bisht
Copy link
Author

Hi, I have updated the branch and it seems the build check is still pending (“Expected - waiting for status to be reported”).
Kindly approve the workflow run or review the PR when you get some time.
Thank you

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