InConstraintCompositionTest, tests
#testMixedConstraintTargetsInComposedAndComposingConstraintsCauseException()
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.
Thanks,
Matt