Package | Description |
---|---|
ratpack.groovy.test.handling | |
ratpack.server |
Objects used to start a ratpack application.
|
ratpack.test.embed |
Support for creating embedded applications at test time, for testing Ratpack features and extensions.
|
ratpack.test.handling |
Modifier and Type | Method and Description |
---|---|
GroovyRequestFixture |
GroovyRequestFixture.serverConfig(Action<? super ServerConfig.Builder> action)
Configures the server config to have no base dir and given configuration.
|
GroovyRequestFixture |
GroovyRequestFixture.serverConfig(Path baseDir,
Action<? super ServerConfig.Builder> action)
Configures the server config to have the given base dir and given configuration.
|
Modifier and Type | Method and Description |
---|---|
ServerConfig.Builder |
ServerConfig.Builder.add(ConfigSource configSource)
Adds a configuration source.
|
ServerConfig.Builder |
ServerConfig.Builder.address(InetAddress address)
Sets the address to bind to.
|
static ServerConfig.Builder |
ServerConfig.baseDir(File baseDir)
Create a new builder, using the given file as the base dir.
|
static ServerConfig.Builder |
ServerConfig.baseDir(Path baseDir)
Create a new builder, using the given file as the base dir.
|
ServerConfig.Builder |
ServerConfig.Builder.configureObjectMapper(Action<ObjectMapper> action)
Configures the object mapper used for binding configuration data to arbitrary objects.
|
ServerConfig.Builder |
ServerConfig.Builder.development(boolean development)
Whether or not the application is "development".
|
static ServerConfig.Builder |
ServerConfig.embedded()
Creates a builder configured to use no base dir, development mode and an ephemeral port.
|
static ServerConfig.Builder |
ServerConfig.embedded(Path baseDir)
Creates a builder configured to use the given base dir, development mode and an ephemeral port.
|
ServerConfig.Builder |
ServerConfig.Builder.env()
Adds a configuration source for environment variables starting with the prefix
"RATPACK_".
|
ServerConfig.Builder |
ServerConfig.Builder.env(EnvironmentParser environmentParser)
Adds a configuration source for environment variables using custom parsing logic.
|
ServerConfig.Builder |
ServerConfig.Builder.env(String prefix)
Adds a configuration source for environment variables starting with the specified prefix.
|
ServerConfig.Builder |
ServerConfig.Builder.env(String prefix,
Function<String,String> mapFunc)
Adds a configuration source for environment variables starting with the specified prefix.
|
static ServerConfig.Builder |
ServerConfig.findBaseDir()
Creates a server config builder with the
base dir as the “directory” on the classpath that contains a file called .ratpack . |
static ServerConfig.Builder |
ServerConfig.findBaseDir(String markerFilePath)
Creates a server config builder with the
base dir as the “directory” on the classpath that contains the marker file at the given path. |
ServerConfig.Builder |
ServerConfig.Builder.json(ByteSource byteSource)
Adds a configuration source for a JSON file.
|
ServerConfig.Builder |
ServerConfig.Builder.json(Path path)
Adds a configuration source for a JSON file.
|
ServerConfig.Builder |
ServerConfig.Builder.json(String path)
Adds a configuration source for a JSON file.
|
ServerConfig.Builder |
ServerConfig.Builder.json(URL url)
Adds a configuration source for a JSON file.
|
ServerConfig.Builder |
ServerConfig.Builder.maxContentLength(int maxContentLength)
The max number of bytes a request body can be.
|
static ServerConfig.Builder |
ServerConfig.noBaseDir()
Creates a builder configured to use no base dir.
|
ServerConfig.Builder |
ServerConfig.Builder.onError(Action<? super Throwable> errorHandler)
Sets the error handler that will be used for added configuration sources.
|
ServerConfig.Builder |
ServerConfig.Builder.port(int port)
Sets the port to listen for requests on.
|
ServerConfig.Builder |
ServerConfig.Builder.props(ByteSource byteSource)
Adds a configuration source for a properties file.
|
ServerConfig.Builder |
ServerConfig.Builder.props(Map<String,String> map)
Adds a configuration source for a Map (flat key-value pairs).
|
ServerConfig.Builder |
ServerConfig.Builder.props(Path path)
Adds a configuration source for a properties file.
|
ServerConfig.Builder |
ServerConfig.Builder.props(Properties properties)
Adds a configuration source for a properties object.
|
ServerConfig.Builder |
ServerConfig.Builder.props(String path)
Adds a configuration source for a properties file.
|
ServerConfig.Builder |
ServerConfig.Builder.props(URL url)
Adds a configuration source for a properties file.
|
ServerConfig.Builder |
ServerConfig.Builder.publicAddress(URI publicAddress)
The public address of the application.
|
ServerConfig.Builder |
ServerConfig.Builder.require(String pointer,
Class<?> type)
Declares that it is required that the server config provide an object of the given type at the given path.
|
ServerConfig.Builder |
ServerConfig.Builder.ssl(SSLContext sslContext)
The SSL context to use if the application serves content over HTTPS.
|
ServerConfig.Builder |
ServerConfig.Builder.sysProps()
Adds a configuration source for system properties starting with the prefix "ratpack.".
|
ServerConfig.Builder |
ServerConfig.Builder.sysProps(String prefix)
Adds a configuration source for system properties starting with the specified prefix.
|
ServerConfig.Builder |
ServerConfig.Builder.threads(int threads)
The number of threads to use.
|
ServerConfig.Builder |
ServerConfig.Builder.yaml(ByteSource byteSource)
Adds a configuration source for a YAML file.
|
ServerConfig.Builder |
ServerConfig.Builder.yaml(Path path)
Adds a configuration source for a YAML file.
|
ServerConfig.Builder |
ServerConfig.Builder.yaml(String path)
Adds a configuration source for a YAML file.
|
ServerConfig.Builder |
ServerConfig.Builder.yaml(URL url)
Adds a configuration source for a YAML file.
|
Modifier and Type | Method and Description |
---|---|
default RatpackServerSpec |
RatpackServerSpec.serverConfig(ServerConfig.Builder builder)
Convenience function that
builds the config from the given builder and delegates to RatpackServerSpec.serverConfig(ServerConfig) . |
Modifier and Type | Method and Description |
---|---|
static EmbeddedApp |
EmbeddedApp.fromServer(ServerConfig.Builder serverConfig,
Action<? super RatpackServerSpec> definition)
Creates an embedded application using the given server config, and server creating function.
|
Modifier and Type | Method and Description |
---|---|
RequestFixture |
RequestFixture.serverConfig(Action<? super ServerConfig.Builder> action)
Configures the server config to have no base dir and given configuration.
|
RequestFixture |
RequestFixture.serverConfig(Path baseDir,
Action<? super ServerConfig.Builder> action)
Configures the server config to have the given base dir and given configuration.
|