public final class ClientDriver extends Object
| Constructor and Description |
|---|
ClientDriver(ClientDriverJettyHandler handler)
Constructor.
|
ClientDriver(ClientDriverJettyHandler handler,
int port)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
ClientDriverExpectation |
addExpectation(ClientDriverRequest request,
ClientDriverResponse response)
Add in an expected
ClientDriverRequest/ClientDriverResponse pair. |
String |
getBaseUrl()
Get the base URL which the ClientDriver is running on.
|
static int |
getFreePort()
Gets a free port on localhost for binding to.
|
void |
shutdown()
Shutdown the server and calls
verify(). |
void |
shutdownQuietly()
Shutdown the server without verifying expectations.
|
void |
verify()
Verifies that all expectations have been met and nothing unexpected has been requested.
|
public ClientDriver(ClientDriverJettyHandler handler)
handler - The ClientDriverJettyHandler to use.public ClientDriver(ClientDriverJettyHandler handler, int port)
handler - The ClientDriverJettyHandler to use.port - The port to listen on. Expect startup errors if this port is
not free.public String getBaseUrl()
public static int getFreePort()
public void verify()
ClientDriverFailedExpectationException is thrown with plenty of detail, and your test will fail!public void shutdownQuietly()
public void shutdown()
verify().public ClientDriverExpectation addExpectation(ClientDriverRequest request, ClientDriverResponse response)
ClientDriverRequest/ClientDriverResponse pair.request - The expected requestresponse - The response to serve to that requestCopyright © 2013. All Rights Reserved.