Package org.mockserver.integration
Class ClientAndServer
java.lang.Object
org.mockserver.client.MockServerClient
org.mockserver.integration.ClientAndServer
- All Implemented Interfaces:
Closeable,AutoCloseable,org.mockserver.stop.Stoppable
public class ClientAndServer
extends org.mockserver.client.MockServerClient
- Author:
- jamesdbloom
-
Field Summary
Fields inherited from class org.mockserver.client.MockServerClient
portFuture -
Constructor Summary
ConstructorsConstructorDescriptionClientAndServer(Integer... ports) ClientAndServer(String remoteHost, Integer remotePort, Integer... ports) ClientAndServer(org.mockserver.configuration.Configuration configuration, Integer... ports) ClientAndServer(org.mockserver.configuration.Configuration configuration, String remoteHost, Integer remotePort, Integer... ports) -
Method Summary
Modifier and TypeMethodDescriptiongetPort()booleanbooleanopenUI()Launch UI and wait the default period to allow the UI to launch and start collecting logs, this ensures that the log are visible in the UI even if MockServer is shutdown by a test shutdown function, such as After, AfterClass, AfterAll, etcLaunch UI and wait a specified period to allow the UI to launch and start collecting logs, this ensures that the log are visible in the UI even if MockServer is shutdown by a test shutdown function, such as After, AfterClass, AfterAll, etcregisterListener(ExpectationsListener expectationsListener) static voidsetLogEventListener(Consumer<org.mockserver.log.model.LogEntry> listener) static ClientAndServerstartClientAndServer(Integer... port) static ClientAndServerstartClientAndServer(String remoteHost, Integer remotePort, Integer... port) static ClientAndServerstartClientAndServer(List<Integer> ports) static ClientAndServerstartClientAndServer(org.mockserver.configuration.Configuration configuration, Integer... port) static ClientAndServerstartClientAndServer(org.mockserver.configuration.Configuration configuration, String remoteHost, Integer remotePort, Integer... port) static ClientAndServerstartClientAndServer(org.mockserver.configuration.Configuration configuration, List<Integer> ports) voidstop()Methods inherited from class org.mockserver.client.MockServerClient
advanceClock, asyncApiStatus, bind, clear, clear, clear, clear, clear, clear, clearGrpcDescriptors, clearServiceChaos, clockStatus, close, contextPath, crud, debugMismatch, freezeClock, freezeClock, hasStarted, hasStopped, hasStopped, isRunning, isSecure, loadAsyncApi, remoteAddress, removeServiceChaos, reset, resetClock, retrieveActiveExpectations, retrieveActiveExpectations, retrieveConfiguration, retrieveGrpcServices, retrieveLogEntries, retrieveLogEntries, retrieveLogEntriesByCorrelationId, retrieveLogMessages, retrieveLogMessagesArray, retrieveLogsByCorrelationId, retrieveMetrics, retrieveRecordedExpectations, retrieveRecordedExpectations, retrieveRecordedRequests, retrieveRecordedRequests, retrieveRecordedRequestsAndResponses, retrieveRecordedRequestsAndResponses, sendExpectation, serviceChaosStatus, setProxyConfiguration, setRequestOverride, setServiceChaos, setServiceChaos, stop, updateConfiguration, uploadGrpcDescriptor, upsert, upsert, verify, verify, verify, verify, verify, verify, verify, verify, verify, verify, verifyAsyncMessage, verifyZeroInteractions, when, when, when, when, withControlPlaneJWT, withControlPlaneJWT, withProxyConfiguration, withRequestOverride, withSecure
-
Constructor Details
-
ClientAndServer
-
ClientAndServer
-
ClientAndServer
-
ClientAndServer
-
-
Method Details
-
startClientAndServer
-
startClientAndServer
public static ClientAndServer startClientAndServer(org.mockserver.configuration.Configuration configuration, List<Integer> ports) -
startClientAndServer
-
startClientAndServer
public static ClientAndServer startClientAndServer(org.mockserver.configuration.Configuration configuration, Integer... port) -
startClientAndServer
public static ClientAndServer startClientAndServer(String remoteHost, Integer remotePort, Integer... port) -
startClientAndServer
public static ClientAndServer startClientAndServer(org.mockserver.configuration.Configuration configuration, String remoteHost, Integer remotePort, Integer... port) -
openUI
Launch UI and wait the default period to allow the UI to launch and start collecting logs, this ensures that the log are visible in the UI even if MockServer is shutdown by a test shutdown function, such as After, AfterClass, AfterAll, etc- Overrides:
openUIin classorg.mockserver.client.MockServerClient
-
openUI
Launch UI and wait a specified period to allow the UI to launch and start collecting logs, this ensures that the log are visible in the UI even if MockServer is shutdown by a test shutdown function, such as After, AfterClass, AfterAll, etc- Overrides:
openUIin classorg.mockserver.client.MockServerClient- Parameters:
timeUnit- TimeUnit the time unit, for example TimeUnit.SECONDSpause- the number of time units to delay before the function returns to ensure the UI is receiving logs
-
isRunning
public boolean isRunning()- Overrides:
isRunningin classorg.mockserver.client.MockServerClient
-
hasStarted
public boolean hasStarted()- Overrides:
hasStartedin classorg.mockserver.client.MockServerClient
-
stopAsync
- Overrides:
stopAsyncin classorg.mockserver.client.MockServerClient
-
stop
public void stop()- Specified by:
stopin interfaceorg.mockserver.stop.Stoppable- Overrides:
stopin classorg.mockserver.client.MockServerClient
-
getPort
- Overrides:
getPortin classorg.mockserver.client.MockServerClient
-
getLocalPort
-
getLocalPorts
-
getRemoteAddress
-
registerListener
-
setLogEventListener
-