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

TRUNK-6030 : The allergy field in the Allergy UI should validate the input string #4534

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Update AllergyValidatorTest.java
TRUNK-6030 : validate the input string
  • Loading branch information
subhamkumarr committed Jan 17, 2024
commit e4b53264ccd45f9b8e01302fc7abf2905f07ca64
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,6 @@ public void validate_shouldRejectNumericAllergenValue() {
Errors errors = new BindException(allergy,"allergy");
validator.validate(allergy, errors);
assertTrue(errors.hasErrors());
Copy link
Member

Choose a reason for hiding this comment

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

This should actually validate the error message.

Copy link
Author

Choose a reason for hiding this comment

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

@ibacher Sir, please check I made the changes.

Copy link
Author

Choose a reason for hiding this comment

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

@ibacher could you please review my PR.

assertThat(errors.getFieldError("allergen").getCode(), is("your_expected_error_code_here"));
assertThat(errors.getFieldError("allergen").getCode(), is("Allergen cannot be numeric value"));
}
}