[bv-dev] group conversion conflict between bean properties constrained in different ways

Matt Benson mbenson at apache.org
Fri Apr 13 15:12:15 EDT 2018


Hi all,

Consider
InvalidGroupConversionInPropertyLevelOverridingTest#testGroupConversionsAreAdditiveAndExceptionIsThrownForMultipleConversionWithSameSource():

This test purports to enforce that a ValidationException is thrown because
a property specifies  multiple group conversions from the Default group.
However, the example actually specifies one via the annotated getter, and
the other via the XML-configured field. I can't find that the spec is
perfectly clear on this, but it is clear that a property should be accessed
using the mechanism of constraint declaration. I don't recall where, but
the TCK tests proper validation of field vs. getter even when the objects
returned are different. I would therefore argue that there could be some
legitimate reason to apply a different group conversion to field vs.
getter, and that the test case should be changed to specify the XML
constraint via getter as does the User class definition overridden.

Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20180413/b8027863/attachment.html 


More information about the beanvalidation-dev mailing list