Announcement Announcement Module
No announcement yet.
MissingMethodException exception when running Grails tests in STS Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • MissingMethodException exception when running Grails tests in STS


    I am new to both Grails and STS/Eclipse. I am getting the following MissingMethodException with the following message when I attempt to run a very simple integration test by right clicking on the test class and selecting Run As > Junit Test from the menu:

    groovy.lang.MissingMethodException: No signature of method: is applicable for argument types: () values: []
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter. unwrap(
    at org.codehaus.groovy.runtime.callsite.PogoMetaClass
    at org.codehaus.groovy.runtime.callsite.CallSiteArray .defaultCall(
    at org.codehaus.groovy.runtime.callsite.AbstractCallS
    at org.codehaus.groovy.runtime.callsite.AbstractCallS

    The domain class that I am trying to test looks like this:
    package test

    class User {
    String userId;
    String password;
    String homepage;
    Date dateCreated;

    static constraints = {

    My integration test looks like this:
    <code>package test

    import grails.test.*

    class UserIntegrationTests extends GrailsUnitTestCase {
    void testSaveInitialUser() {
    def user = new User(userId: 'hello', password: 'secret', homepage: '');


    User foundUser = User.get(;
    assertEquals(foundUser.userId, foundUser.userId);

    The project containing the code listed above was created using the Grails project wizard provided by STS. I'm using STS version 2.3.2 with Grails v.1.2.2.

    The test passes when i run it using the test-app command on the grails command prompt.

    Any help would be greatly appreciated!

    Thanks in advance

  • #2
    Hi Alex,

    Don't you need to use mockDomain() before the save method comes into existence for those kinds of test? (of course, that doesn't quite explain why it is different when run through test-app...).

    Andy Clement