Closed nathandunn closed 4 years ago
Sorry, this is GORM 7.0.6 and Grails 4.0.4 (though also tried with 7.02 and 4.0.3 respecitively).
Ah, quick answer is:
mockDomain Relationship
So should be:
class SomeServiceSpec extends Specification implements ServiceUnitTest<SomeService>, DataTest{
def setup() {
mockDomain Domain1
mockDomain Domain2
// mockDomain Relationship
}
void "test1"(){
when: "test"
def d1 = new Domain1().save(failOnError: true)
def d2 = new Domain2().save(failOnError: true)
new Relationship(from:d1, to: d2).save(failOnError: true)
}
The it works fine.
I can provide better documentation, but at a glance:
Where relationship is a relationship:
I get an error that is:
Maybe there is a better way to do this, but it seems like there should be a
mockRelationship
or it should properly percieve that it is a RelationshipPersistentEntity instead of a KeyValuePersistentEntity.