IntegrationTestCase does not rollback transactions, causing test cases to have side effects
17 views
Skip to first unread message
Gregory Krasnow
unread,
Oct 3, 2012, 4:31:26 PM10/3/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to grails-jax...@googlegroups.com
Under normal Grails development, Integration Tests would extend GroovyTestCase which causes every test to run in its own transaction and rollback the transaction at the end of the test. This makes it easier on the developer since test cases are less likely to leave side effects this way. However IntegrationTestCase seems to turn off transactions (static transactional = false) and does not seem to have a rollback mechanism. Thus when testing POST, anything created remains and future tests can have unpredictable behavior. Has anyone found a good way around this issue? Thanks.