public interface GroovyEmbeddedApp
extends ratpack.test.embed.EmbeddedApp
EmbeddedApp.
import ratpack.groovy.test.embed.GroovyEmbeddedApp
GroovyEmbeddedApp.of {
handlers {
get {
render "root"
}
}
} test {
assert getText() == "root"
}
EphemeralBaseDir,
EmbeddedApp| Modifier and Type | Method and Description |
|---|---|
static GroovyEmbeddedApp |
from(ratpack.test.embed.EmbeddedApp embeddedApp) |
static GroovyEmbeddedApp |
fromHandler(groovy.lang.Closure<?> handler) |
static GroovyEmbeddedApp |
fromHandlers(groovy.lang.Closure<?> handlers) |
static GroovyEmbeddedApp |
fromServer(ratpack.server.ServerConfigBuilder serverConfig,
groovy.lang.Closure<?> definition) |
static GroovyEmbeddedApp |
fromServer(ratpack.server.ServerConfig serverConfig,
groovy.lang.Closure<?> definition) |
static GroovyEmbeddedApp |
of(groovy.lang.Closure<?> definition)
Groovy version of
EmbeddedApp.of(Action) that accepts Closure to configure the application. |
static GroovyEmbeddedApp |
ratpack(groovy.lang.Closure<?> script)
Creates an
EmbeddedApp from the provided closure delegating to Groovy.Ratpack. |
default void |
test(groovy.lang.Closure<?> test) |
static GroovyEmbeddedApp from(ratpack.test.embed.EmbeddedApp embeddedApp)
static GroovyEmbeddedApp of(@DelegatesTo(value=ratpack.groovy.server.GroovyRatpackServerSpec.class,strategy=1) groovy.lang.Closure<?> definition) throws java.lang.Exception
EmbeddedApp.of(Action) that accepts Closure to configure the application.
The closure delegates to GroovyRatpackServerSpec.
definition - the application definitionjava.lang.Exceptionstatic GroovyEmbeddedApp ratpack(@DelegatesTo(value=ratpack.groovy.Groovy.Ratpack.class,strategy=1) groovy.lang.Closure<?> script) throws java.lang.Exception
EmbeddedApp from the provided closure delegating to Groovy.Ratpack.
import static ratpack.groovy.test.embed.GroovyEmbeddedApp.ratpack
ratpack {
bindings {
bindInstance String, "root"
}
handlers {
get {
render get(String)
}
}
} test {
assert getText() == "root"
}
script - the application definitionjava.lang.Exceptionstatic GroovyEmbeddedApp fromServer(ratpack.server.ServerConfigBuilder serverConfig, @DelegatesTo(value=ratpack.groovy.server.GroovyRatpackServerSpec.class,strategy=1) groovy.lang.Closure<?> definition)
static GroovyEmbeddedApp fromServer(ratpack.server.ServerConfig serverConfig, @DelegatesTo(value=ratpack.groovy.server.GroovyRatpackServerSpec.class,strategy=1) groovy.lang.Closure<?> definition)
static GroovyEmbeddedApp fromHandler(@DelegatesTo(value=ratpack.groovy.handling.GroovyContext.class,strategy=1) groovy.lang.Closure<?> handler)
static GroovyEmbeddedApp fromHandlers(@DelegatesTo(value=ratpack.groovy.handling.GroovyChain.class,strategy=1) groovy.lang.Closure<?> handlers)
default void test(@DelegatesTo(value=ratpack.test.http.TestHttpClient.class,strategy=1)
groovy.lang.Closure<?> test)
throws java.lang.Exception
java.lang.Exception