@CompileDynamic trait DomainRepoTest
Should works as a drop in replacement for the Grails Testing Support's
grails.testing.gorm.DomainUnitTest for testing a single entity using Generics
Its walks the tree so if you have a Book that has a required Author association you only need to do
implement DomainRepoTest
Type | Name and description |
---|---|
Class<D> |
_entityClass |
D |
entity |
Type Params | Return Type | Name and description |
---|---|---|
|
D |
build() ******************** builders, util and setup methods for spock blocks ************ |
|
D |
build(Map args) |
|
Map |
buildCreateMap(Map args) |
|
Map |
buildMap(Map args = [:]) |
|
Map |
buildUpdateMap(Map args) |
|
D |
createEntity(Map args = [:]) |
|
void |
entityContains(Map expected) asserts that the entity's props contains the expected map |
|
D |
get(Serializable id) |
|
Class<?>[] |
getDomainClassesToMock() this is called by the DataTestSetupSpecInterceptor which calls the mockDomains. |
|
Class<D> |
getEntityClass() |
|
D |
persistEntity(Map args = [:]) |
|
def |
removeEntity(Serializable remId = null) |
|
void |
testCreate() ******************** Helpers Methods for expect or then spock blocks ************ |
|
void |
testPersist() |
|
void |
testRemove() |
|
void |
testUpdate() |
|
D |
updateEntity(Map args = [:]) |
********************* builders, util and setup methods for spock blocks ************
asserts that the entity's props contains the expected map
this is called by the DataTestSetupSpecInterceptor which calls the mockDomains.
********************* Helpers Methods for expect or then spock blocks ************