public abstract class EmbeddedApplicationSupport extends 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 RatpackServer |
createServer()
Subclass implementation hook for creating the server implementation.
|
URI |
getAddress()
The address of the application under test, which is guaranteed to be accepting requests.
|
RatpackServer |
getServer()
The server.
|
public RatpackServer getServer()
The first time this method is called, it will call createServer()
.
getServer
in interface EmbeddedApplication
public URI getAddress()
getAddress
in interface ApplicationUnderTest
protected abstract 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 Closeable
close
in interface AutoCloseable