public interface GroovyRequestFixture extends RequestFixture
| Modifier and Type | Method and Description |
|---|---|
GroovyRequestFixture |
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. |
GroovyRequestFixture |
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. |
GroovyRequestFixture |
header(String name,
String value)
Set a request header value.
|
GroovyRequestFixture |
launchConfig(Action<? super LaunchConfigBuilder> action)
Configures the launch config to have no base dir and given configuration.
|
GroovyRequestFixture |
launchConfig(Path baseDir,
Action<? super LaunchConfigBuilder> action)
Configures the launch config to have the given base dir and given configuration.
|
GroovyRequestFixture |
method(String method)
Set the request method (case insensitive).
|
GroovyRequestFixture |
pathBinding(Map<String,String> pathTokens)
Adds a path binding, with the given path tokens.
|
GroovyRequestFixture |
pathBinding(String boundTo,
String pastBinding,
Map<String,String> pathTokens)
Adds a path binding, with the given path tokens and parts.
|
GroovyRequestFixture |
registry(Action<? super RegistrySpec> action)
Configures the context registry.
|
GroovyRequestFixture |
registry(Closure<?> closure) |
GroovyRequestFixture |
responseHeader(String name,
String value)
Set a response header value.
|
GroovyRequestFixture |
timeout(int timeoutSeconds)
Sets the maximum time to allow the handler under test to produce a result.
|
GroovyRequestFixture |
uri(String uri)
The URI of the request.
|
getRegistry, handle, handleGroovyRequestFixture registry(@DelegatesTo(value=RegistryBuilder.class,strategy=1) Closure<?> closure)
GroovyRequestFixture header(String name, String value)
RequestFixtureBy default there are no request headers.
header in interface RequestFixturename - the header namevalue - the header valueGroovyRequestFixture body(byte[] bytes, String contentType)
RequestFixtureContent-Type request header of the given value.
By default the body is empty.
body in interface RequestFixturebytes - the request body in bytescontentType - the content type of the request bodyGroovyRequestFixture body(String text, String contentType)
RequestFixtureContent-Type request header of the given value.
By default the body is empty.
body in interface RequestFixturetext - the request body as a stringcontentType - the content type of the request bodyGroovyRequestFixture responseHeader(String name, String value)
RequestFixtureCan be used to simulate the setting of a response header by an upstream handler.
By default there are no request headers.
responseHeader in interface RequestFixturename - the header namevalue - the header valueGroovyRequestFixture method(String method)
RequestFixture
The default method is "GET".
method in interface RequestFixturemethod - the request methodGroovyRequestFixture uri(String uri)
RequestFixtureNo encoding is performed on the given value. It is expected to be a well formed URI path string (potentially including query and fragment strings)
uri in interface RequestFixtureuri - the URI of the requestGroovyRequestFixture timeout(int timeoutSeconds)
RequestFixtureAs handlers may execute asynchronously, a maximum time limit must be used to guard against never ending handlers.
timeout in interface RequestFixturetimeoutSeconds - the maximum number of seconds to allow the handler(s) under test to produce a resultGroovyRequestFixture registry(Action<? super RegistrySpec> action) throws Exception
RequestFixtureregistry in interface RequestFixtureaction - a registry specification actionException - any thrown by actionGroovyRequestFixture pathBinding(Map<String,String> pathTokens)
RequestFixtureBy default, there are no path tokens and no path binding.
pathBinding in interface RequestFixturepathTokens - the path tokens to make available to the handler(s) under testGroovyRequestFixture pathBinding(String boundTo, String pastBinding, Map<String,String> pathTokens)
RequestFixtureBy default, there are no path tokens and no path binding.
pathBinding in interface RequestFixturepathTokens - the path tokens and binding to make available to the handler(s) under testGroovyRequestFixture launchConfig(Path baseDir, Action<? super LaunchConfigBuilder> action) throws Exception
RequestFixture
By default the launch config is equivalent to LaunchConfigBuilder.noBaseDir().build().
launchConfig in interface RequestFixturebaseDir - the launch config base diraction - configuration of the launch configException - any thrown by actionGroovyRequestFixture launchConfig(Action<? super LaunchConfigBuilder> action) throws Exception
RequestFixture
By default the launch config is equivalent to LaunchConfigBuilder.noBaseDir().build().
launchConfig in interface RequestFixtureaction - configuration of the launch configException - any thrown by action