When using {{@TestMixin(DomainClassUnitTestMixin)}} and the {{mockDomain}} method to mock collaborating domains in a unit test, integration tests that later use a dynamic finder on the mocked domain behave inconsistently.
See issue GRAILS-8176 for some more detail (includes testcase as zip).
See the Environment information for specific environment details.
Original Reporter: tiggerizzy Environment: Not Specified Version: 2.0-M2 Migrated From: http://jira.grails.org/browse/GRAILS-8181
When using {{@TestMixin(DomainClassUnitTestMixin)}} and the {{mockDomain}} method to mock collaborating domains in a unit test, integration tests that later use a dynamic finder on the mocked domain behave inconsistently.
See issue GRAILS-8176 for some more detail (includes testcase as zip).
See the Environment information for specific environment details.
I have pushed the testcase to github for simplicity. https://github.com/bendoerr/GRAILS-8181-Testcase
You should expect the following failure when running {{grails test-app}} against the testcase on a windows environment.
{code} | Completed 4 unit tests, 0 failed in 4262ms | Running 1 integration test... 1 of 1 | Failure: testThatFails(org.grails.bug.DomainIntegrationTests) | Assertion failed:
assert Gizmo.findByName(g.name) | | | null | Giz org.grails.bug.Gizmo : 1
| Completed 1 integration test, 1 failed in 439ms {code}