@groovy.transform.Trait @groovy.transform.CompileStatic trait DataTest extends org.grails.testing.GrailsUnitTest
Type | Name and description |
---|---|
Session |
currentSession |
boolean |
domainsHaveBeenMocked |
Type Params | Return Type | Name and description |
---|---|---|
|
AbstractDatastore |
getDataStore()
|
|
AbstractDatastore |
getDatastore() |
|
java.lang.Class<?>[] |
getDomainClassesToMock() |
|
boolean |
getFailOnError() |
|
org.springframework.transaction.PlatformTransactionManager |
getTransactionManager() |
|
void |
mockDataService(java.lang.Class<?> serviceClass) Called by the ServiceUnitTest class (via reflection) to create a data service |
|
void |
mockDomain(java.lang.Class<?> domainClassToMock, java.util.List domains) Mocks a domain class providing the equivalent GORM behavior but against an in-memory concurrent hash map instead of a database |
|
void |
mockDomains(java.lang.Class<?>[] domainClassesToMock) Mocks domain classes providing the equivalent GORM behavior but against an in-memory concurrent hash map instead of a database |
Methods inherited from class | Name |
---|---|
interface org.grails.testing.GrailsUnitTest |
org.grails.testing.GrailsUnitTest#getConfig(), org.grails.testing.GrailsUnitTest#getApplicationContext(), org.grails.testing.GrailsUnitTest#getGrailsApplication(), org.grails.testing.GrailsUnitTest#cleanupGrailsApplication(), org.grails.testing.GrailsUnitTest#getLocalOverride(), org.grails.testing.GrailsUnitTest#getOptionalServletContext(), org.grails.testing.GrailsUnitTest#getMessageSource(), org.grails.testing.GrailsUnitTest#defineBeans(groovy.lang.Closure), org.grails.testing.GrailsUnitTest#defineBeans(java.lang.Object), org.grails.testing.GrailsUnitTest#doWithSpring(), org.grails.testing.GrailsUnitTest#doWithConfig(), org.grails.testing.GrailsUnitTest#getIncludePlugins(), org.grails.testing.GrailsUnitTest#loadExternalBeans() |
Called by the ServiceUnitTest class (via reflection) to create a data service
serviceClass
- The data service abstract class or interfaceMocks a domain class providing the equivalent GORM behavior but against an in-memory concurrent hash map instead of a database
domainClassToMock
- The domain class to mockdomains
- Optional. The list of domains to saveMocks domain classes providing the equivalent GORM behavior but against an in-memory concurrent hash map instead of a database
domainClassesToMock
- The list of domain classes to mock