Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BVTCK-158 Add a test for cascading validation with 2 inner extractions
- Loading branch information
1 parent
9e38d1a
commit c636ae8
Showing
3 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...e/beanvalidation/tck/tests/validation/graphnavigation/containerelement/model/Address.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Bean Validation TCK | ||
* | ||
* License: Apache License, Version 2.0 | ||
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>. | ||
*/ | ||
package org.hibernate.beanvalidation.tck.tests.validation.graphnavigation.containerelement.model; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
|
||
public class Address { | ||
|
||
@NotBlank | ||
private final String street; | ||
|
||
@NotBlank | ||
private final String zipCode; | ||
|
||
@NotBlank | ||
private final String city; | ||
|
||
private Address(String street, String zipCode, String city) { | ||
this.street = street; | ||
this.zipCode = zipCode; | ||
this.city = city; | ||
} | ||
|
||
public static Address invalid() { | ||
return new Address( "avenue Félix Faure", "", "Lyon" ); | ||
} | ||
|
||
public static Address valid() { | ||
return new Address( "avenue Félix Faure", "69003", "Lyon" ); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...anvalidation/tck/tests/validation/graphnavigation/containerelement/model/AddressType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Bean Validation TCK | ||
* | ||
* License: Apache License, Version 2.0 | ||
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>. | ||
*/ | ||
package org.hibernate.beanvalidation.tck.tests.validation.graphnavigation.containerelement.model; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
|
||
public class AddressType { | ||
|
||
private static final AddressType INVALID = new AddressType( "" ); | ||
|
||
private static final AddressType VALID = new AddressType( "Personal" ); | ||
|
||
@NotBlank | ||
private final String type; | ||
|
||
private AddressType(String type) { | ||
this.type = type; | ||
} | ||
|
||
public static AddressType invalid() { | ||
return INVALID; | ||
} | ||
|
||
public static AddressType valid() { | ||
return VALID; | ||
} | ||
} |