[bv-dev] TCK expects constraint definition exception but specifies illegal method arguments first

Matt Benson mbenson at apache.org
Fri Mar 16 15:13:59 EDT 2018

InConstraintCompositionTest, tests
and #testMixedConstraintTargetsInComposingConstraintsCauseException()
expect a ConstraintDefinitionException, but both attempt to validate an
empty Object array for a method whose signature is (int). However, the
methods of ExecutableValidator all declare that an IllegalArgumentException
will be thrown if any parameters to *those* methods do not match. I take
this to mean that a parameter array should be of the same length and
respectively assignable types to the parameter types supported by a method
or constructor, and similarly that a validated return value should actually
be a value that could have been returned by a given method or constructor.
I don't see that there is any specification as to when these
IllegalArgumentExceptions should be thrown, but it seems to me that you
would typically validate the objects you have locally before going off to
look up and validate the metadata for the appropriate bean type. I would
request that the parameter arrays used in these tests be updated to
something actually compatible with the methods in question, which could
only serve to further the emphasis on the actual spec item being verified
by the test method in question.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/beanvalidation-dev/attachments/20180316/75d9c02b/attachment.html 

More information about the beanvalidation-dev mailing list