-
Notifications
You must be signed in to change notification settings - Fork 1
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
Bug/bi 1852 #294
Bug/bi 1852 #294
Conversation
&& StringUtils.isNotBlank(method.getAbbreviation()) | ||
&& StringUtils.isNotBlank(method.getCategory()) | ||
&& StringUtils.isNotBlank(method.getGeneticDiversity()); | ||
boolean isMissingRequiredFields(ProgramBreedingMethodEntity 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.
Please add the private
modifier to this 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.
Explicitly declared the method 'protected'. Added comment 'protected' instead of 'private' so it is accessible to unit test.
|| StringUtils.isBlank(method.getCategory()) | ||
|| StringUtils.isBlank(method.getGeneticDiversity()); | ||
} | ||
boolean isDuplicateMethodNameFoundOnList(ProgramBreedingMethodEntity method, List<ProgramBreedingMethodEntity> programBreedingMethodEntityList) { |
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.
Please add the private
modifier to this method
else if(testMethod.getName()==null && method.getName()==null ){ | ||
isDup = true; | ||
} |
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.
Isn't this not needed because a validation error would have already been thrown for the name not being supplied?
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.
Left it as is to be extra-safe.
else if(testMethod.getAbbreviation()==null && method.getAbbreviation()==null ){ | ||
isDup = true; | ||
} |
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.
Isn't this not needed because a validation error would have already been thrown for the abbreviation not being supplied?
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.
Functionality is good, requested changes around specificity of error messages and some more pedantic code quality things.
src/test/java/org/breedinginsight/services/validators/TraitValidatorUnitTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/breedinginsight/services/impl/BreedingMethodServiceImplTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/breedinginsight/services/impl/BreedingMethodServiceImplTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/breedinginsight/services/impl/BreedingMethodServiceImplTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/breedinginsight/services/impl/BreedingMethodServiceImplTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/breedinginsight/services/impl/BreedingMethodServiceImplTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/breedinginsight/api/v1/controller/BreedingMethodController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/breedinginsight/api/v1/controller/BreedingMethodController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/breedinginsight/services/impl/BreedingMethodServiceImpl.java
Outdated
Show resolved
Hide resolved
… the linter happy
fixed type-o in test titles Improved error messages
the branch did not get merged to develop |
Description
Story: BI-1852 - Duplicate breeding method can be created
Definition: A Breeding Method is a 'duplicate' if: there already exist a breeding method with the same name or abbreviation
Dependencies
bi-web: bug/BI-1852
Testing
Set up
TEST 1 (create new breeding method)
EXPECTED RESULT
--
A breeding method with the name '<name>' is already defined in the system.
or
--
A breeding method with the abbreviation '<abbreviation>' is already defined in the system.
EXPECTED RESULT
TEST 2 (edit existing breeding method)
EXPECTED RESULT
--
A breeding method with the name '<name>' is already defined in the system.
or
--
A breeding method with the abbreviation '<abbreviation>' is already defined in the system.
EXPECTED RESULT
Checklist: