small medium large xlarge

Back to: All Forums  Grails
Generic-user-small
09 Mar 2011, 22:43
Jim Wang (2 posts)

I could not make the any of the findBy* working.

I tried something like this in a unit test file def tekEvt = TekEvent.findByName(‘Jim’)

The test will fail and I found the the following error in the test report: No signature of method: static tekdays.TekEvent.findByName() is applicable for argument types: (java.lang.String) values: [Jim] groovy.lang.MissingMethodException: No signature of method: static tekdays.TekEvent.findByName() is applicable for argument types: (java.lang.String) values: [Jim] at tekdays.TekEventTests.testToString(TekEventTests.groovy:22)

I’m running grails 1.3.6 on a Linux box.

I apprciate if anyone can help.

Thanks, Jim

Generic-user-small
10 Mar 2011, 16:19
Jim Wang (2 posts)

The findBy*’s do work in Bootstrap.groovy but don’t work in unit tests. Maybe hibernate was not initialized when running the tests.

You must be logged in to comment