File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
grails-plugin-testing/src/main/groovy/grails/test/mixin/domain Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -122,17 +122,18 @@ class DomainClassUnitTestMixin extends GrailsUnitTestMixin {
122122
123123 def mockDomains (Class ... domainsClassToMock ) {
124124 initialMockDomainSetup()
125- for (Class c in domainsClassToMock) {
126- PersistentEntity entity = simpleDatastore. mappingContext. addPersistentEntity(c)
125+ Collection<PersistentEntity > entities = simpleDatastore. mappingContext. addPersistentEntities(domainsClassToMock)
126+ for (PersistentEntity entity in entities) {
127+ final c = entity. javaClass
127128 GrailsDomainClass domain = registerGrailsDomainClass(c)
128129
129130 Validator validator = registerDomainClassValidator(domain)
130131 simpleDatastore. mappingContext. addEntityValidator(entity, validator)
131132
132133 }
133134 def enhancer = new GormEnhancer (simpleDatastore, transactionManager)
134- enhancer. enhance()
135135 simpleDatastore. mappingContext. initialize()
136+ enhancer. enhance()
136137 }
137138 /**
138139 * Mocks a domain class providing the equivalent GORM behavior but against an in-memory concurrent hash map instead
You can’t perform that action at this time.
0 commit comments