Package | Description |
---|---|
ratpack.groovy.test | |
ratpack.groovy.test.handling | |
ratpack.test | |
ratpack.test.handling |
Modifier and Type | Method and Description |
---|---|
static GroovyRequestFixture |
GroovyUnitTest.requestFixture(RequestFixture requestFixture)
Create a Groovy request fixture, for unit testing a
Handler , by wrapping the given RequestFixture . |
Modifier and Type | Interface and Description |
---|---|
interface |
GroovyRequestFixture |
Modifier and Type | Method and Description |
---|---|
static RequestFixture |
UnitTest.requestFixture()
Create a request fixture, for unit testing of
handlers . |
Modifier and Type | Method and Description |
---|---|
static HandlingResult |
UnitTest.handle(Action<? super Chain> chainAction,
Action<? super RequestFixture> requestFixtureAction)
Unit test a
Handler chain. |
static HandlingResult |
UnitTest.handle(Handler handler,
Action<? super RequestFixture> action)
Unit test a single
Handler . |
Modifier and Type | Method and Description |
---|---|
RequestFixture |
RequestFixture.body(byte[] bytes,
String contentType)
Sets the request body to be the given bytes, and adds a
Content-Type request header of the given value. |
RequestFixture |
RequestFixture.body(String text,
String contentType)
Sets the request body to be the given string in utf8 bytes, and adds a
Content-Type request header of the given value. |
RequestFixture |
RequestFixture.header(String name,
String value)
Set a request header value.
|
RequestFixture |
RequestFixture.launchConfig(Action<? super LaunchConfigBuilder> action)
Configures the launch config to have no base dir and given configuration.
|
RequestFixture |
RequestFixture.launchConfig(Path baseDir,
Action<? super LaunchConfigBuilder> action)
Configures the launch config to have the given base dir and given configuration.
|
RequestFixture |
RequestFixture.method(String method)
Set the request method (case insensitive).
|
RequestFixture |
RequestFixture.pathBinding(Map<String,String> pathTokens)
Adds a path binding, with the given path tokens.
|
RequestFixture |
RequestFixture.pathBinding(String boundTo,
String pastBinding,
Map<String,String> pathTokens)
Adds a path binding, with the given path tokens and parts.
|
RequestFixture |
RequestFixture.registry(Action<? super RegistrySpec> action)
Configures the context registry.
|
RequestFixture |
RequestFixture.responseHeader(String name,
String value)
Set a response header value.
|
RequestFixture |
RequestFixture.timeout(int timeoutSeconds)
Sets the maximum time to allow the handler under test to produce a result.
|
RequestFixture |
RequestFixture.uri(String uri)
The URI of the request.
|