The first domain works well. But the second domain is not able to have the "build" method
import grails.test.spock.IntegrationSpec
import grails.buildtestdata.mixin.Build
@Build(Domain1)
@Build(Domain2)
class DomainServiceSpec extends IntergrationSpec {
def "test mock" () {
Domain1.build(a: a, b: b, c: c) //working fine
Domain2.build(a: a, b: b, c: c) //"build" method is not recognized
}
}
@Build([Domain1, Domain2])
I suggest you read the plugin documentation: Unit Test Support