Helper utils for mocking spring beans needed to test repository's and domains.
Type Params | Return Type | Name and description |
---|---|---|
|
Closure |
commonBeans() |
|
Class |
findRepoClass(Class domainClass) Finds repository class in same package as domain class. |
|
void |
flushAndClear() |
|
ConfigurableApplicationContext |
getCtx() conveinince shortcut for applicationContext |
|
AbstractDatastore |
getDatastore() FIX for https://github.com/grails/grails-testing-support/issues/22 changes dataStore to lowercase datastore for consistency |
|
void |
mockRepositories(Class<?>... domainClassesToMock) Mocks Repositories for passed in Domain classes. |
|
Closure |
registerRepository(Class domain, Class repoClass) |
|
Set<Class> |
scanRepoClasses(String packageName) No Usages Yet..., scans all repository classes in given package. |
|
void |
setupTransactionService() |
Methods inherited from class | Name |
---|---|
interface GrailsUnitTest |
defineBeans, defineBeans, getApplicationContext, getGrailsApplication, doWithSpring, getOptionalServletContext, doWithConfig, getIncludePlugins, loadExternalBeans, cleanupGrailsApplication, getMessageSource, getConfig |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Finds repository class in same package as domain class. returns a default DefaultGormRepo if no explicit ones are found
conveinince shortcut for applicationContext
FIX for https://github.com/grails/grails-testing-support/issues/22 changes dataStore to lowercase datastore for consistency
Mocks Repositories for passed in Domain classes. If a Repository Class is explicitly defined then this looks for it in the same package The domains should be mocked before this is called
No Usages Yet..., scans all repository classes in given package. may be change to RepoScanner like ClassPathEntityScanner !?