Skip to content

Commit

Permalink
Test annotation with custom message template
Browse files Browse the repository at this point in the history
  • Loading branch information
jirutka committed May 8, 2014
1 parent 203a3d2 commit b2c6577
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ class CommonEachValidatorIT extends Specification {
['a', 'b'] | 'not null values' || true | null
}

def 'validate @EachURL with custom message template'() {
given:
constraint = '@EachURL(protocol="https", message="must be a valid URL with {protocol}")'
expect:
assertViolations(['http://fit.cvut.cz'], false, 'must be a valid URL with https')
}


//////// Helpers ////////

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TestUtils {
import javax.validation.constraints.*
class TestMock {
${annotationLine}
${annotationLine.replace('"', "'")}
public List valuesList = $value
}
"""
Expand Down

0 comments on commit b2c6577

Please sign in to comment.