@groovy.transform.Trait @groovy.transform.CompileStatic trait DataTest extends GrailsUnitTest
Modifiers | Name | Description |
---|---|---|
private Session |
currentSession |
|
private boolean |
domainsHaveBeenMocked |
Fields inherited from class | Fields |
---|---|
trait GrailsUnitTest |
_grailsApplication, _servletContext |
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() |
|
PlatformTransactionManager |
getTransactionManager() |
|
private void |
initialMockDomainSetup() |
|
private void |
initializeMappingContext() |
|
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 |
|
private Validator |
registerDomainClassValidator(PersistentEntity domain) |
|
private void |
registerGrailsDomainClass(java.lang.Class<?> domainClassToMock) |
|
private void |
saveDomainList(PersistentEntity entity, java.util.List domains) |
Methods inherited from class | Name |
---|---|
trait GrailsUnitTest |
cleanupGrailsApplication, cleanupPromiseFactory, defineBeans, defineBeans, doWithConfig, doWithSpring, getApplicationContext, getConfig, getGrailsApplication, getIncludePlugins, getLocalOverride, getMessageSource, getOptionalServletContext, 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