public interface EmbeddedApplication extends ApplicationUnderTest, AutoCloseable
This mechanism can be used for functionally testing isolated sections of an application, or for testing general libraries that provide reusable functionality (e.g. Ratpack Guice modules).
Different implementations expose different API that can be used to define the actual application under test.
As embedded applications also implement ApplicationUnderTest
, they are suitable for use with clients accessing the app via HTTP.
Implementations must ensure that the application is up and receiving request when returning from ApplicationUnderTest.getAddress()
.
Be sure to close()
the application after use to free resources.
LaunchConfigEmbeddedApplication
Modifier and Type | Method and Description |
---|---|
void |
close() |
TestHttpClient |
getHttpClient()
Creates a new test HTTP client that tests this embedded application.
|
RatpackServer |
getServer()
The server for the application.
|
getAddress
RatpackServer getServer()
Calling this method does not implicitly start the server.
TestHttpClient getHttpClient()
void close()
close
in interface AutoCloseable