Package org.mockserver.integration
Class ClientAndServer
- java.lang.Object
-
- org.mockserver.client.MockServerClient
-
- org.mockserver.integration.ClientAndServer
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Stoppable
public class ClientAndServer extends MockServerClient
- Author:
- jamesdbloom
-
-
Field Summary
-
Fields inherited from class org.mockserver.client.MockServerClient
mockServerLogger, portFuture
-
-
Constructor Summary
Constructors Constructor Description ClientAndServer(Integer... ports)
ClientAndServer(String remoteHost, Integer remotePort, Integer... ports)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Integer
getLocalPort()
List<Integer>
getLocalPorts()
Integer
getPort()
Deprecated.use getLocalPort instead of getPortInetSocketAddress
getRemoteAddress()
boolean
isRunning()
Returns whether MockServer is runningstatic ClientAndServer
startClientAndServer(Integer... port)
static ClientAndServer
startClientAndServer(String remoteHost, Integer remotePort, Integer... port)
ClientAndServer
startClientAndServer(List<Integer> ports)
void
stop()
Stop MockServer gracefully (only support for Netty version, not supported for WAR version)-
Methods inherited from class org.mockserver.client.MockServerClient
bind, clear, clear, close, contextPath, isRunning, isSecure, remoteAddress, reset, retrieveActiveExpectations, retrieveActiveExpectations, retrieveLogMessages, retrieveLogMessagesArray, retrieveRecordedExpectations, retrieveRecordedExpectations, retrieveRecordedRequests, retrieveRecordedRequests, retrieveRecordedRequestsAndResponses, retrieveRecordedRequestsAndResponses, sendExpectation, stop, verify, verify, verifyZeroInteractions, when, when, when, withSecure
-
-
-
-
Method Detail
-
startClientAndServer
public ClientAndServer startClientAndServer(List<Integer> ports)
-
startClientAndServer
public static ClientAndServer startClientAndServer(Integer... port)
-
startClientAndServer
public static ClientAndServer startClientAndServer(String remoteHost, Integer remotePort, Integer... port)
-
isRunning
public boolean isRunning()
Description copied from class:MockServerClient
Returns whether MockServer is running- Overrides:
isRunning
in classMockServerClient
-
stop
public void stop()
Description copied from class:MockServerClient
Stop MockServer gracefully (only support for Netty version, not supported for WAR version)- Specified by:
stop
in interfaceStoppable
- Overrides:
stop
in classMockServerClient
-
getPort
@Deprecated public Integer getPort()
Deprecated.use getLocalPort instead of getPort
-
getLocalPort
public Integer getLocalPort()
-
getRemoteAddress
public InetSocketAddress getRemoteAddress()
-
-