Grails UnitTest

Posted by Tomáš on Stack Overflow See other posts from Stack Overflow or by Tomáš
Published on 2010-05-04T12:11:43Z Indexed on 2010/05/04 12:18 UTC
Read the original article Hit count: 217

Filed under:

Hi (it is propably stupid question)

how can acquire Domain class from database in test?

class PollServiceTests extends GrailsUnitTestCase {
    Integer id = 1

    void testSomething() {
       Teacher teacher1 = Teacher.get(id)
       assert teacher1 != null
    }
}

I always get null or

No signature of method: cz.jak.Teacher.get() is applicable for argument types: (java.lang.Integer) values: [1]

thanks a lot Tom

© Stack Overflow or respective owner

Related posts about grails