Im has an unsuccessful integration test due to test contamination (tests pass or fail depending on the order in which they are performed).
What puzzles me a bit is that it seems that the unit test, where I mocked some data with mockDomain(Media.class,[new Movie(...)]), is still present and available in other tests, even for integration tests.
Is this the expected behavior? Why is the test structure not cleared after itself for each test?
EDIT
Really weird, the documentation says that:
Integration tests differ from unit tests in that you have full access to the Grails environment as part of the test. Grails will use the in-memory HSQLDB database for integration tests and clear all data from the database between each test.
However, in my integration test, I have the following code
protected void setUp() {
super.setUp()
assertEquals("TEST POLLUTION!",0,Movie.count())
...
}
Which gives me the result:
TEST POLLUTION! expected:<0> but was:<1>
The value of what is data, if it should not be!
Looking at the data present in the Movie.list () file, I find that the data matches the data set in the previous unit test
protected void setUp() {
super.setUp()
mockDomain(Media.class,[
new Movie(id:1,name:'testMovie')
])
...
}
Any idea why I am having these problems?