Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BVTCK-155 Add a test for @OverridesAttribute default name()
- Loading branch information
1 parent
3b98792
commit 10eec1f
Showing
2 changed files
with
78 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
44 changes: 44 additions & 0 deletions
44
...sts/constraints/constraintcomposition/FrenchZipcodeWithDefaultOverridesAttributeName.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,44 @@ | ||
/** | ||
* 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.constraints.constraintcomposition; | ||
|
||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.TYPE; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
import javax.validation.Constraint; | ||
import javax.validation.OverridesAttribute; | ||
import javax.validation.Payload; | ||
import javax.validation.constraints.Pattern; | ||
|
||
|
||
/** | ||
* @author Guillaume Smet | ||
*/ | ||
@NotEmpty | ||
@Pattern(regexp = "bar") | ||
@Constraint(validatedBy = {}) | ||
@Documented | ||
@Target({ METHOD, FIELD, TYPE }) | ||
@Retention(RUNTIME) | ||
public @interface FrenchZipcodeWithDefaultOverridesAttributeName { | ||
|
||
@OverridesAttribute(constraint = Pattern.class) | ||
String message() default "Wrong zip code"; | ||
|
||
Class<?>[] groups() default { }; | ||
|
||
Class<? extends Payload>[] payload() default {}; | ||
|
||
@OverridesAttribute(constraint = Pattern.class) | ||
String regexp() default "\\d*"; | ||
} |