generated from micronaut-projects/micronaut-project-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79c3e9d
commit 16874f0
Showing
4 changed files
with
86 additions
and
4 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
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 |
---|---|---|
|
@@ -246,7 +246,7 @@ class ValidatorSpec extends Specification { | |
void "validate property argument - with iterable constraints"() { | ||
given: | ||
var e = new ValidatorSpecClasses.Email(["[email protected]", "", "[email protected]"]) | ||
var violations = validator.validate(e); | ||
var violations = validator.validate(e) | ||
violations = violations.sort{it->it.getPropertyPath().toString()} | ||
|
||
expect: | ||
|
@@ -777,6 +777,33 @@ class ValidatorSpec extends Specification { | |
constraintViolations[0].toString() == 'DefaultConstraintViolation{rootBean=class io.micronaut.validation.validator.$BookService$Definition$Intercepted, invalidValue=50, path=saveBook.pages}' | ||
constraintViolations[1].toString() == 'DefaultConstraintViolation{rootBean=class io.micronaut.validation.validator.$BookService$Definition$Intercepted, invalidValue=, path=saveBook.title}' | ||
} | ||
void "test cascade to container"() { | ||
given: | ||
def salad = new ValidatorSpecClasses.Salad([ | ||
new ValidatorSpecClasses.Ingredient("carrot"), | ||
new ValidatorSpecClasses.Ingredient("") | ||
]) | ||
def violations = validator.validate(salad) | ||
expect: | ||
violations.size() == 1 | ||
violations[0].invalidValue == "" | ||
} | ||
void "test cascade to container with setter"() { | ||
given: | ||
def salad = new ValidatorSpecClasses.SaladWithSetter() | ||
salad.ingredients = [ | ||
new ValidatorSpecClasses.Ingredient("carrot"), | ||
new ValidatorSpecClasses.Ingredient("") | ||
] | ||
def violations = validator.validate(salad) | ||
expect: | ||
violations.size() == 1 | ||
violations[0].invalidValue == "" | ||
} | ||
} | ||
@Introspected | ||
|
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
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