Spock Integration Spec 内のドメイン クラスで gorm find メソッドを使用しようとしています。
私のコード:
class myDomainClassSpec extends IntegrationSpec{
...
def 'my test'() {
when: ...
then:
MyDomainClass.find { id == 1 }
}
...
}
これは失敗し、次をスローします。
groovy.lang.MissingPropertyException: No such property: id for class: grails.gorm.DetachedCriteria
代わりにコーディングすると、 MyDomainClass.findAll().find { id == 1 } が機能します。
何か案は??