To create a test for a groovy class
  1. Do one of the following:
    • Use intention action Create test.
    • Press ⇧⌘T or ⇧⌘T⇧⌘T or ⇧⌘T^ ⇧ T, ⌃⇧T or ⌃⇧T^ ⇧ T, ⌃⇧T or ⌃⇧T, and choose Create New Test.

      ../../Shared/choose_test_for_Groovy.png

  2. In the Create Test dialog box, specify the required information, as described in the section Creating Tests.

    ../../Shared/create_test_groovy.png

  3. In the editor of the created test file, in the left gutter, click on the ../../Shared/run_grails_from_left_gutter_icon.png icon to execute run/debug configuration.

    ../../Shared/run_groovy_tests.png

    You can also use a context menu to run or debug your test.

You can navigate between Groovy tests and test subjects (Navigate | Test / Test Subject). If a test class doesn't yet exist, IntelliJ IDEA suggests to create one.