Grails domain class unit test errors
题
I wrote the following domain class with its unit test. When I run the tests, I get the error message
No such property: admittedMobileUser
. When I comment that line in domain class I get the same problem on other fields. Does anyone knows how to solve it?
class MobileUser {
String userName
String userDevice="Android"
Integer userCluster
Boolean admittedMobileUser
Date lastTimeUpdatedUserSpaceTime=new Date()
byte[] userSpaceTimeXml
static constraints = {
userName blank:false, unique:true
userDevice blank:false
userCluster validator : {val-> return val > 0}
admittedMobileUser
lastTimeUpdatedUserSpaceTime
userSpaceTimeXml maxSize:1024*1024
}
String toString(){
return "${userName}_${userCluster}"
}
}
解决方案
remove such rows from constraints :
....
admittedMobileUser
lastTimeUpdatedUserSpaceTime
....
or add minimum one constraint to each!
不隶属于 StackOverflow