Conversation
| && StringUtils.isNotBlank(method.getAbbreviation()) | ||
| && StringUtils.isNotBlank(method.getCategory()) | ||
| && StringUtils.isNotBlank(method.getGeneticDiversity()); | ||
| boolean isMissingRequiredFields(ProgramBreedingMethodEntity method) { |
There was a problem hiding this comment.
Please add the private modifier to this method
There was a problem hiding this comment.
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.
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.
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.
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.
Isn't this not needed because a validation error would have already been thrown for the abbreviation not being supplied?
mlm483
left a comment
There was a problem hiding this comment.
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
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: