Affects Version/s: Core 2.2.0
Fix Version/s: Core 2.2.0
During cleanup/refactor of ValidatorTests (~ 6/50 validator tests) I found quite a number of tests that said they were testing case X but didnt prepare the target object properly so they were actually testing case Y.
In our tests of the validators we often just check if there are errors without looking at the error code.
In case of global errors that you can create in the validator by errors.reject("myerror.code") it might be because you need to loop through the errors.getGlobalErrors() list
- make it easy for devs to assert global errors of specific codes
- remove duplication, since almost every validator test needs this
Add a custom hamcrest matcher HasGlobalErrors which enables
Provide factories which enables the above after static imports of
Show use of matcher in PersonNameValidatorTest and ConceptValidatorTest