grails test-app -------------------------------------------------------
Running Unit Tests…
Running test FooTests...FAILURE
Unit Tests Completed in 464ms …
-------------------------------------------------------
Tests failed: 0 errors, 1 failures grails test-app SimpleController grails test-app *Controller grails test-app some.org.*Controller grails test-app some.org.* grails test-app some.org.**.* grails test-app SimpleController.testLogin grails test-app some.org.* SimpleController.testLogin BookController grails test-app unit: grails test-app :spock grails test-app functional:spock grails.test.mixin.TestFor grails.test.mixin.Mock grails.test.mixin.TestMixin grails.test.mixin.support.GrailsUnitTestMixin grails.test.mixin.domain.DomainClassUnitTestMixin grails.test.mixin.services.ServiceUnitTestMixin grails.test.mixin.web.ControllerUnitTestMixin grails.test.mixin.web.FiltersUnitTestMixin grails.test.mixin.web.GroovyPageUnitTestMixin grails.test.mixin.web.UrlMappingsUnitTestMixin grails.test.mixin.hibernate.HibernateTestMixin import grails.test.mixin.TestFor import spock.lang.Specification@TestFor(SimpleController) class SimpleControllerSpec extends Specification { void "test hello"() { when: controller.hello() then: response.text == 'hello' } }
static mappings = {
    "/actionOne"(controller: "simple", action: "action1")
    "/actionTwo"(controller: "simple", action: "action2")
} import com.demo.SimpleController
import grails.test.mixin.TestFor
import spock.lang.Specification
@TestFor(UrlMappings)
@Mock(SimpleController)
class UrlMappingsSpec extends Specification {
    void "test forward mappings"() {
        expect:
        assertForwardUrlMapping("/actionOne", controller: 'simple', action: "action1")
        assertForwardUrlMapping("/actionTwo", controller: 'simple', action: "action2")
    }
} 
class Math extends Specification {
    def "maximum of two numbers"(int a, int b, int c) {
        expect:
        Math.max(a, b) == c
        where:
        a | b | c
        1 | 3 | 3
        7 | 4 | 4
        0 | 0 | 0
    }
} 
static GrailsWebApplicationContext applicationContext
static GrailsWebApplicationContext mainContext
static GrailsApplication grailsApplication
static ConfigObject config
static MessageSource messageSource
Map validationErrorsMap = new IdentityHashMap()
Set loadedCodecs = [] 

service.metaClass.myMethod = { //does nothing//we don't care if it was called or not }
service.metaClass.someMethod = { input ->
    assert input == "expected"
} test ':fixtures:1.3' BuildConfig.groovyplugins { test ':fixtures:1.3' }