public class ClientAndServer extends MockServerClient
portFuture
Constructor and Description |
---|
ClientAndServer(Integer... ports) |
ClientAndServer(String remoteHost,
Integer remotePort,
Integer... ports) |
Modifier and Type | Method and Description |
---|---|
Integer |
getLocalPort() |
List<Integer> |
getLocalPorts() |
Integer |
getPort()
Deprecated.
use getLocalPort instead of getPort
|
InetSocketAddress |
getRemoteAddress() |
boolean |
hasStarted()
Returns whether MockServer has started, if called after MockServer has been stopped
this method will block for 5 seconds while confirming that MockServer is not starting
|
boolean |
isRunning()
Returns whether MockServer is running, if called too quickly after starting MockServer
this may return false because MockServer has not yet started, to ensure MockServer has
started use hasStarted()
|
static ClientAndServer |
startClientAndServer(Integer... port) |
static ClientAndServer |
startClientAndServer(List<Integer> ports) |
static ClientAndServer |
startClientAndServer(String remoteHost,
Integer remotePort,
Integer... port) |
void |
stop()
Stop MockServer gracefully (only support for Netty version, not supported for WAR version)
|
Future |
stopAsync()
Stop MockServer gracefully (only support for Netty version, not supported for WAR version)
|
bind, clear, clear, close, contextPath, hasStarted, hasStopped, hasStopped, isRunning, isSecure, remoteAddress, reset, retrieveActiveExpectations, retrieveActiveExpectations, retrieveLogMessages, retrieveLogMessagesArray, retrieveRecordedExpectations, retrieveRecordedExpectations, retrieveRecordedRequests, retrieveRecordedRequests, retrieveRecordedRequestsAndResponses, retrieveRecordedRequestsAndResponses, sendExpectation, setRequestOverride, stop, upsert, verify, verify, verifyZeroInteractions, when, when, when, when, withSecure
public ClientAndServer(Integer... ports)
public static ClientAndServer startClientAndServer(List<Integer> ports)
public static ClientAndServer startClientAndServer(Integer... port)
public static ClientAndServer startClientAndServer(String remoteHost, Integer remotePort, Integer... port)
public boolean isRunning()
MockServerClient
isRunning
in class MockServerClient
public boolean hasStarted()
MockServerClient
hasStarted
in class MockServerClient
public Future stopAsync()
MockServerClient
stopAsync
in class MockServerClient
public void stop()
MockServerClient
stop
in interface Stoppable
stop
in class MockServerClient
@Deprecated public Integer getPort()
public Integer getLocalPort()
public InetSocketAddress getRemoteAddress()
Copyright © 2020. All rights reserved.