Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 99bc89db7a
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (25 sloc) 0.683 kb
package grails.test.web
import spock.lang.Specification
import grails.artefact.Artefact
import grails.test.mixin.TestFor
/**
*/
@TestFor(FooController)
class AsyncControllerTestSpec extends Specification{
void "Test that it is possible to test interaction with the Servlet 3.0 async API"() {
when:"A controller that uses the async API is called"
controller.index()
then:"The async response is testable"
response.text == 'Hello World'
}
}
@Artefact("Controller")
class FooController {
def index() {
def ctx = startAsync()
ctx.start {
render "Hello World"
ctx.complete()
}
}
}
Jump to Line
Something went wrong with that request. Please try again.