Skip to content

Commit 8c06ac8

Browse files
authored
Clarified usage of the plugin
1 parent da37583 commit 8c06ac8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ dependencies {
1717
Here is an example of a command object that uses the plugin:
1818

1919
```groovy
20-
@Validateable
21-
class PhoneNumber {
20+
class PhoneNumber implements Validateable {
2221
long id
2322
String countryCode
2423
String areaCode
@@ -33,8 +32,7 @@ Here is an example of a command object that uses the plugin:
3332
telephoneType(cascade: true)
3433
}
3534
36-
@Validateable
37-
static class TelephoneType {
35+
static class TelephoneType implements Validateable {
3836
String id
3937
boolean countryCodeRecommended
4038
@@ -56,6 +54,13 @@ When running a unit test, the cascade constraint isn't registered with Grails. T
5654
`org.grails.testing.GrailsUnitTest` and the following code must be added to the `setup()` method of the test:
5755

5856
```groovy
57+
@Override
58+
Closure doWithSpring() {
59+
return {
60+
constraintEvaluator(DefaultConstraintEvaluator)
61+
}
62+
}
63+
5964
def setup() {
6065
CascadeConstraintRegistration.register(applicationContext)
6166
}

0 commit comments

Comments
 (0)