Actually, there result of the validation is correct. Check the returned Set of {{ConstraintValidation}}s. If you look at the log, you see that this his a warning message. The reason is actually, that the default resource bundle ValidationMessages.properties has an error in the message descriptor for LuhnCheck (in fact Mod10Check, Mod10Check and ModCheck have the same problem). The message is:
It should be:
LuhnCheck is relevant in this case, since it @CreditCard is implemented as composing constraint. Obviously we need to fix the messages (and maybe improve on the log message). For now you have several options:
-
Ignore the warning in the log (the result is correct)
-
Configure logging to ignore messages from this logger category: log4j.logger.org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTerm=ERROR in case of Log4J
-
Add your own ValidationMessages.properties to the root of the classpath (in case you have not done so yet) and add:
Hope this helps for now and thanks for reporting this.
|