<div dir="ltr">Hi,<div><br></div><div>I believe that the test is correct, since the redefinition of default group sequences is local to the type hosting @GroupSequence, i.e. it&#39;s not propagated to associated elements (referenced properties, method parameters or return values). Please check out <a href="http://beanvalidation.org/2.0/spec/#constraintdeclarationvalidationprocess-validationroutine-graphvalidation">http://beanvalidation.org/2.0/spec/#constraintdeclarationvalidationprocess-validationroutine-graphvalidation</a> and examples 5.29 - 5.32 which show a comparable situation (only for regular bean validation, not for method validation).</div><div><br></div><div>For OrderServiceWithRedefinedDefaultGroupSequence this means, that @GroupSequence({ Basic.class, OrderServiceWithRedefinedDefaultGroupSequence.class }) only applies to the constraints hosted on the methods of that class itself, but not to the constraints on the Item class as we traverse to it. As the default group is requested, validation of the constraints on OrderServiceWithRedefinedDefaultGroupSequence will stop after the Basic group, but for Item, all constraints of its default group (which isn&#39;t re-defined) are validated. Hence the @Size constraint is expected within the set of constraint violations.</div><div><br></div><div>--Gunnar</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-04-04 15:23 GMT+02:00 Guillaume Smet <span dir="ltr">&lt;<a href="mailto:guillaume.smet@gmail.com" target="_blank">guillaume.smet@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Hi Matt,<br></div><div class="gmail_quote"><span class=""><br>On Tue, Apr 3, 2018 at 11:22 PM, Matt Benson <span dir="ltr">&lt;<a href="mailto:mbenson@apache.org" target="_blank">mbenson@apache.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello, I am encountering failures on three tests from<br>
MethodValidationTest in the TCK:<br>
<br>
* #constructorParameterValidatio<wbr>nWithRedefinedDefaultGroupSequ<wbr>ence()<br>
* #methodParameterValidationWith<wbr>RedefinedDefaultGroupSequence(<wbr>)<br>
* #methodReturnValueValidationWi<wbr>thRedefinedDefaultGroupSequenc<wbr>e()<br>
<br>
In each case I am failing to pick up a @Size constraint from the<br>
Default group of an Item parameter or Order return value. However, due<br>
to the group sequence redefinition of Basic, Default on the bean class<br>
in question I am confused as to why I am expected to pick up the<br>
failures from the Default group after having encountered a @NotNull<br>
constraint violation in the Basic group. Thanks for any help here.<br></blockquote><div><br></div></span><div>I would tend to agree with you. (The fact that Item also has a different Basic group does not help to understand the issue though).<br><br></div><div>AFAIU the spec (<a href="http://beanvalidation.org/2.0/spec/#constraintdeclarationvalidationprocess-validationroutine-methodconstructorvalidation" target="_blank">http://beanvalidation.org/2.<wbr>0/spec/#<wbr>constraintdeclarationvalidatio<wbr>nprocess-validationroutine-<wbr>methodconstructorvalidation</a>), we should do:<br></div><div>- For each group<br></div><div>  - For each parameter, apply constraints<br></div><div>  - For each cascading parameter, cascade<br></div></div><br></div><div class="gmail_extra">This in no particular order if there is no group sequence. If a group sequence is defined, we should exit as soon as we have a violation for a given group<br><br></div><div class="gmail_extra">Currently, the RI does:<br></div><div class="gmail_extra">- For each group<br></div><div class="gmail_extra">  - For each parameter, apply constraints<br></div><div class="gmail_extra">    - exit as soon as I have a constraint if group sequence<br></div><div class="gmail_extra">- For each group<br></div><div class="gmail_extra">  - For each cascading parameter, cascade<br>    - exit as soon as I have a constraint if group sequence<br><br></div><div class="gmail_extra">In the aforementioned case:<br></div><div class="gmail_extra">1/ we apply the Basic constraints for the parameter constraints<br></div><div class="gmail_extra">2/ we exit as soon as we have a violation, we don&#39;t validate the Default group<br></div><div class="gmail_extra">3/ we apply cascading<br></div><div class="gmail_extra">   - no violation for the Basic group<br></div><div class="gmail_extra">   - we validate the default group<br></div><div class="gmail_extra">   - we exit as soon as we have a violation<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">As per spec, I think we should exit just after 2/<br><br></div><div class="gmail_extra">Gunnar, any insights?<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra"><br>-- <br></div><div class="gmail_extra">Guillaume<br></div></font></span></div>
<br>______________________________<wbr>_________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br></blockquote></div><br></div>