File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
grails-datastore-gorm-tck/src/main/groovy/grails/gorm/tests Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,14 @@ import grails.persistence.Entity
55class ConstraintsSpec extends GormDatastoreSpec {
66
77 void " Test constraints with static default values" () {
8- given : " A Test class with static constraint values"
9- def ce = new ConstrainedEntity (num :1000 , str :" ABC" )
8+ given : " A Test class with static constraint values"
9+ def ce = new ConstrainedEntity (num : 1000 , str : " ABC" )
1010
11- when : " saved is called"
12- ce. save()
11+ when : " saved is called"
12+ ce. save()
1313
14- then :
15- ce. hasErrors() == false
14+ then :
15+ ! ce. hasErrors()
1616 }
1717
1818 @Override
@@ -21,6 +21,7 @@ class ConstraintsSpec extends GormDatastoreSpec {
2121 }
2222}
2323
24+ @SuppressWarnings ([" ClashingTraitMethods" , " UnnecessaryQualifiedReference" ])
2425@Entity
2526class ConstrainedEntity implements Serializable {
2627
@@ -33,9 +34,9 @@ class ConstrainedEntity implements Serializable {
3334
3435 static constraints = {
3536
36- num(maxSize : MAX_VALUE ) /* Must be MyDomainClass .MAX_VALUE in order work with redis */
37+ num(maxSize : ConstrainedEntity . MAX_VALUE )
3738 str validator : { val , obj ->
38- if (val != null && ! ALLOWABLE_VALUES . contains(val)) {/* Must be MyDomainClass.ALLOWABLE_VALUES in order work with redis */
39+ if (val != null && ! ConstrainedEntity . ALLOWABLE_VALUES . contains(val)) {
3940 return [' not.valid' ]
4041 }
4142 }
You can’t perform that action at this time.
0 commit comments