Package | Description |
---|---|
ratpack.groovy.test.handling | |
ratpack.test.handling |
Modifier and Type | Interface and Description |
---|---|
interface |
GroovyRequestFixture
A more Groovy friendly version of
RequestFixture . |
Modifier and Type | Method and Description |
---|---|
static GroovyRequestFixture |
GroovyRequestFixture.requestFixture(RequestFixture requestFixture)
Create a Groovy request fixture, for unit testing a
Handler , by wrapping the given RequestFixture . |
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(CharSequence name,
String value)
Set a request header value.
|
RequestFixture |
RequestFixture.localAddress(HostAndPort local)
Set the local address to which this request is made.
|
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.protocol(String protocol)
Set the HTTP protocol for the request.
|
RequestFixture |
RequestFixture.registry(Action<? super RegistrySpec> action)
Configures the context registry.
|
RequestFixture |
RequestFixture.remoteAddress(HostAndPort remote)
Set the remote address from which the request is made.
|
static RequestFixture |
RequestFixture.requestFixture()
Create a request fixture, for unit testing of
handlers . |
RequestFixture |
RequestFixture.responseHeader(CharSequence name,
String value)
Set a response header value.
|
RequestFixture |
RequestFixture.serverConfig(Action<? super ServerConfigBuilder> action)
Configures the server config to have no base dir and given configuration.
|
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.
|
Modifier and Type | Method and Description |
---|---|
static HandlingResult |
RequestFixture.handle(Action<? super Chain> chainAction,
Action<? super RequestFixture> requestFixtureAction)
Unit test a
Handler chain. |
static HandlingResult |
RequestFixture.handle(Handler handler,
Action<? super RequestFixture> action)
Unit test a single
Handler . |