-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
base: master
Are you sure you want to change the base?
Changes from all commits
29c680c
c6877ea
4ea96dc
e97ebe6
22c9a46
19764d3
e4b5326
78742af
339f7eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,4 +191,13 @@ public void validate_shouldRejectNumericReactionValue() { | |
validator.validate(allergy, errors); | ||
assertTrue(errors.hasErrors()); | ||
} | ||
@Test | ||
public void validate_shouldRejectNumericAllergenValue() { | ||
Allergen allergen = new Allergen(AllergenType.DRUG, null , "45" ); | ||
allergy.setAllergen(allergen); | ||
Errors errors = new BindException(allergy,"allergy"); | ||
validator.validate(allergy, errors); | ||
assertTrue(errors.hasErrors()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should actually validate the error message. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ibacher Sir, please check I made the changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ibacher could you please review my PR. |
||
assertTrue(errors.getAllErrors().stream() | ||
.anyMatch(error -> "allergyapi.allergy.Allergen.cannotContainNumeric".equals(error.getCode()))); } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indent here should be with tabs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, the curly brace belongs on a new line. Please ensure you're following the Java Conventions and see this to setup your IDE (basically, whatever mechanism will take an Eclipse formatting configuration). |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Insert a space between the method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@subhamkumarr Did you see this comment?