grails - call to .save() on domain class fails with no signature of method .save() in unit test -


i'm using grails 1.3.2 in netbeans. have simple unit test fails error:

no signature of method: com.maxrecall.maxrequire.domain.release.save() applicable argument types: (java.util.linkedhashmap) values: [[flush:true]] possible solutions: wait(), any(), wait(long), iscase(java.lang.object), use([ljava.lang.object;), sleep(long)

the relevant code is:

release rel = new release() ... rel.save(flush:true)  

the same code works in bootstrap.groovy. have tried various variations on .save() (.save , without parameters.

it's unit test, there's no spring, hibernate, etc. have mock behavior want.

if you're testing persistence, need convert test integration test, since testing persistence unit tests tests mocking framework. integration test uses @ minimum in-memory database, although can switch test instance of mysql/oracle/etc.

if you're testing controllers or other users of domain classes , want them work can focus on testing current class, use mockdomain , other mock methods available in grails unit test base classes.

this described in detail in documentation - see http://grails.org/doc/latest/guide/9.%20testing.html


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -