I follow the example in the book Grails In Action. My integration test fails because searches in the sample code return null references. I used the findAll () call, and now it shows that my test data is not saved; all.size is returned as zero.
void testBasicDynamicFinders() { new User(userId: 'glen', password: 'secret', profile: new Profile(email: ' glen@glensmith.com ')).save() new User(userId: 'peter', password: 'sesame', profile: new Profile(homepage: 'http://www.peter.com/')).save() def all = User.findAll() assertEquals 2, all.size() }
I tried using save (flush: true) to no avail.
I also included one of the save statements in the try ... catch structure, but an exception does not occur.
Graales really kicks my ass. Please help me?
source share