File tree Expand file tree Collapse file tree 2 files changed +63
-1
lines changed
java/org/hibernate/validator/test/constraints/annotations/hv Expand file tree Collapse file tree 2 files changed +63
-1
lines changed Original file line number Diff line number Diff line change 1+ package org .hibernate .validator .test .constraints .annotations .hv ;
2+
3+ import java .util .List ;
4+ import java .util .Map ;
5+ import java .util .Set ;
6+
7+ import org .hibernate .validator .test .constraints .annotations .AbstractConstrainedTest ;
8+
9+ import org .testng .annotations .Test ;
10+
11+ import jakarta .validation .Valid ;
12+
13+ public class ValidAnnotationTest extends AbstractConstrainedTest {
14+
15+ @ Test
16+ public void listAsContainer () {
17+ class Foo {
18+
19+ @ Valid
20+ private List <@ Valid String > prop ;
21+
22+ public Foo (List <String > prop ) {
23+ this .prop = prop ;
24+ }
25+ }
26+
27+ Foo foo = new Foo (List .of ("K1" ));
28+ validator .validate (foo );
29+ }
30+
31+ @ Test
32+ public void setAsContainer () {
33+ class Foo {
34+
35+ @ Valid
36+ private Set <@ Valid String > prop ;
37+
38+ public Foo (Set <String > prop ) {
39+ this .prop = prop ;
40+ }
41+ }
42+
43+ Foo foo = new Foo (Set .of ("K1" ));
44+ validator .validate (foo );
45+ }
46+
47+ @ Test
48+ public void mapAsContainer () {
49+ class Foo {
50+
51+ @ Valid
52+ private Map <String , @ Valid String > prop ;
53+
54+ public Foo (Map <String , String > prop ) {
55+ this .prop = prop ;
56+ }
57+ }
58+
59+ Foo foo = new Foo (Map .of ("K1" , "V1" ));
60+ validator .validate (foo );
61+ }
62+ }
Original file line number Diff line number Diff line change 11# License: Apache License, Version 2.0
22# See the LICENSE file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
3- rootLogger.level = error
3+ rootLogger.level = warn
44rootLogger.appenderRefs = console
55rootLogger.appenderRef.console.ref = console
66
You can’t perform that action at this time.
0 commit comments