public abstract class EmbeddedApplicationSupport extends java.lang.Object implements EmbeddedApplication
ApplicationUnderTest requirements.
Implementations just need to implement createServer().
| Constructor and Description |
|---|
EmbeddedApplicationSupport() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Stops the server returned by
getServer(). |
protected abstract ratpack.server.RatpackServer |
createServer()
Subclass implementation hook for creating the server implementation.
|
java.net.URI |
getAddress()
The address of the application under test, which is guaranteed to be accepting requests.
|
ratpack.server.RatpackServer |
getServer()
The server.
|
public ratpack.server.RatpackServer getServer()
The first time this method is called, it will call createServer().
getServer in interface EmbeddedApplicationpublic java.net.URI getAddress()
getAddress in interface ApplicationUnderTestprotected abstract ratpack.server.RatpackServer createServer()
Only ever called once.
public void close()
getServer().
Exceptions thrown by calling RatpackServer.stop() are suppressed and written to System.err.
close in interface java.io.Closeableclose in interface java.lang.AutoCloseable