Constructor and Description |
---|
MockServerClient(Configuration configuration,
CompletableFuture<Integer> portFuture)
Start the client communicating to a MockServer on localhost at the port
specified with the Future
|
MockServerClient(Configuration configuration,
String host,
int port)
Start the client communicating to a MockServer at the specified host and port
for example:
|
MockServerClient(Configuration configuration,
String host,
int port,
String contextPath)
Start the client communicating to a MockServer at the specified host and port
and contextPath for example:
|
Constructor and Description |
---|
WebSocketClientRegistry(Configuration configuration,
MockServerLogger mockServerLogger) |
Constructor and Description |
---|
ExpandedParameterDecoder(Configuration configuration,
MockServerLogger mockServerLogger) |
JsonSchemaBodyDecoder(Configuration configuration,
MockServerLogger mockServerLogger,
Expectation expectation,
HttpRequest httpRequest) |
MockServerHttpServerCodec(Configuration configuration,
MockServerLogger mockServerLogger,
boolean isSecure,
Certificate[] clientCertificates,
Integer port) |
MockServerHttpServerCodec(Configuration configuration,
MockServerLogger mockServerLogger,
boolean isSecure,
SocketAddress socketAddress,
Certificate[] clientCertificates) |
NettyHttpToMockServerHttpRequestDecoder(Configuration configuration,
MockServerLogger mockServerLogger,
boolean isSecure,
Certificate[] clientCertificates,
Integer port) |
Modifier and Type | Method and Description |
---|---|
Configuration |
Configuration.actionHandlerThreadCount(Integer actionHandlerThreadCount)
Number of threads for the action handler thread pool
|
Configuration |
Configuration.alwaysCloseSocketConnections(Boolean alwaysCloseSocketConnections)
If true socket connections will always be closed after a response is returned, if false connection is only closed if request header indicate connection should be closed.
|
Configuration |
Configuration.attemptToProxyIfNoMatchingExpectation(Boolean attemptToProxyIfNoMatchingExpectation)
If true (the default) when no matching expectation is found, and the host header of the request does not match MockServer's host, then MockServer attempts to proxy the request if that fails then a 404 is returned.
|
Configuration |
Configuration.certificateAuthorityCertificate(String certificateAuthorityCertificate)
File system path or classpath location of custom X.509 Certificate for Certificate Authority for TLS, the certificate must be a X509 PEM file and must match the certificateAuthorityPrivateKey
|
Configuration |
Configuration.certificateAuthorityPrivateKey(String certificateAuthorityPrivateKey)
File system path or classpath location of custom Private Key for Certificate Authority for TLS, the private key must be a PKCS#8 or PKCS#1 PEM file and must match the certificateAuthorityCertificate
To convert a PKCS#1 (i.e.
|
Configuration |
Configuration.clientNioEventLoopThreadCount(Integer clientNioEventLoopThreadCount)
Client Netty worker thread pool size for handling requests and response.
|
static Configuration |
Configuration.configuration() |
Configuration |
Configuration.controlPlaneJWTAuthenticationExpectedAudience(String controlPlaneJWTAuthenticationExpectedAudience)
Audience claim (i.e.
|
Configuration |
Configuration.controlPlaneJWTAuthenticationJWKSource(String controlPlaneJWTAuthenticationJWKSource)
JWK source used when JWT authentication is enabled for control plane requests
|
Configuration |
Configuration.controlPlaneJWTAuthenticationMatchingClaims(Map<String,String> controlPlaneJWTAuthenticationMatchingClaims)
Matching claims expected when JWT authentication is enabled for control plane requests
|
Configuration |
Configuration.controlPlaneJWTAuthenticationRequired(Boolean controlPlaneJWTAuthenticationRequired)
Require JWT authentication for all control plane requests
|
Configuration |
Configuration.controlPlaneJWTAuthenticationRequiredClaims(Set<String> controlPlaneJWTAuthenticationRequiredClaims)
Required claims that should exist (i.e.
|
Configuration |
Configuration.controlPlanePrivateKeyPath(String controlPlanePrivateKeyPath)
File system path or classpath location of a fixed custom private key for control plane connections using mTLS for authentication.
|
Configuration |
Configuration.controlPlaneTLSMutualAuthenticationCAChain(String controlPlaneTLSMutualAuthenticationCAChain)
File system path or classpath location of custom mTLS (TLS client authentication) X.509 Certificate Chain for control plane mTLS authentication
|
Configuration |
Configuration.controlPlaneTLSMutualAuthenticationRequired(Boolean controlPlaneTLSMutualAuthenticationRequired)
Require mTLS (also called client authentication and two-way TLS) for all control plane requests
|
Configuration |
Configuration.controlPlaneX509CertificatePath(String controlPlaneX509CertificatePath)
File system path or classpath location of a fixed custom X.509 Certificate for control plane connections using mTLS for authentication.
|
Configuration |
Configuration.corsAllowCredentials(Boolean corsAllowCredentials)
The value used for CORS in the access-control-allow-credentials header.
|
Configuration |
Configuration.corsAllowHeaders(String corsAllowHeaders)
the value used for CORS in the access-control-allow-headers and access-control-expose-headers headers.
|
Configuration |
Configuration.corsAllowMethods(String corsAllowMethods)
the value used for CORS in the access-control-allow-methods header.
|
Configuration |
Configuration.corsAllowOrigin(String corsAllowOrigin)
the value used for CORS in the access-control-allow-origin header.
|
Configuration |
Configuration.corsMaxAgeInSeconds(Integer corsMaxAgeInSeconds)
The value used for CORS in the access-control-max-age header.
|
Configuration |
Configuration.detailedMatchFailures(Boolean detailedMatchFailures)
If true (the default) the log event recording that a request matcher did not match will include a detailed reason why each non-matching field did not match.
|
Configuration |
Configuration.directoryToSaveDynamicSSLCertificate(String directoryToSaveDynamicSSLCertificate)
Directory used to save the dynamically generated Certificate Authority X.509 Certificate and Private Key.
|
Configuration |
Configuration.disableLogging(Boolean disableLogging)
Disable all logging and processing of log events
|
Configuration |
Configuration.disableSystemOut(Boolean disableSystemOut)
Disable printing log to system out for JVM, default is enabled
|
Configuration |
Configuration.dynamicallyCreateCertificateAuthorityCertificate(Boolean dynamicallyCreateCertificateAuthorityCertificate)
Enable dynamic creation of Certificate Authority X509 certificate and private key.
|
Configuration |
Configuration.enableCORSForAllResponses(Boolean enableCORSForAllResponses)
Enable CORS for all responses from MockServer, including the REST API and expectation responses
|
Configuration |
Configuration.enableCORSForAPI(Boolean enableCORSForAPI)
Enable CORS for MockServer REST API so that the API can be used for javascript running in browsers, such as selenium
|
Configuration |
Configuration.forwardHttpProxy(InetSocketAddress forwardHttpProxy)
Use HTTP proxy (i.e.
|
Configuration |
Configuration.forwardHttpsProxy(InetSocketAddress forwardHttpsProxy)
Use HTTPS proxy (i.e.
|
Configuration |
Configuration.forwardProxyAuthenticationPassword(String forwardProxyAuthenticationPassword)
Password for proxy authentication when using HTTPS proxy (i.e.
|
Configuration |
Configuration.forwardProxyAuthenticationUsername(String forwardProxyAuthenticationUsername)
Username for proxy authentication when using HTTPS proxy (i.e.
|
Configuration |
Configuration.forwardProxyCertificateChain(String forwardProxyCertificateChain)
File system path or classpath location of custom mTLS (TLS client authentication) X.509 Certificate Chain for Trusting (i.e.
|
Configuration |
Configuration.forwardProxyPrivateKey(String forwardProxyPrivateKey)
File system path or classpath location of custom Private Key for proxied TLS connections out of MockServer, the private key must be a PKCS#8 or PKCS#1 PEM file
|
Configuration |
Configuration.forwardProxyTLSCustomTrustX509Certificates(String forwardProxyTLSCustomTrustX509Certificates)
File system path or classpath location of custom file for trusted X509 Certificate Authority roots for forwarded or proxied requests, the certificate chain must be a X509 PEM file.
|
Configuration |
Configuration.forwardProxyTLSX509CertificatesTrustManagerType(ForwardProxyTLSX509CertificatesTrustManager forwardProxyTLSX509CertificatesTrustManagerType)
Configure trusted set of certificates for forwarded or proxied requests.
|
Configuration |
Configuration.forwardSocksProxy(InetSocketAddress forwardSocksProxy)
Use SOCKS proxy for all outbound / forwarded requests, support TLS tunnelling of TCP connections
|
Configuration |
Configuration.initializationClass(String initializationClass)
The class (and package) used to initialize expectations in MockServer at startup, if set MockServer will load and call this class to initialize expectations when is starts.
|
Configuration |
Configuration.initializationJsonPath(String initializationJsonPath)
The path to the json file used to initialize expectations in MockServer at startup, if set MockServer will load this file and initialise expectations for each item in the file when is starts.
|
Configuration |
Configuration.launchUIForLogLevelDebug(Boolean launchUIForLogLevelDebug)
If true (the default) the ClientAndServer constructor will open the UI in the default browser when the log level is set to DEBUG.
|
Configuration |
Configuration.livenessHttpGetPath(String livenessHttpGetPath)
Path to support HTTP GET requests for status response (also available on PUT /mockserver/status).
|
Configuration |
Configuration.localBoundIP(String localBoundIP)
The local IP address to bind to for accepting new socket connections
|
Configuration |
Configuration.logLevel(org.slf4j.event.Level level)
Override the default logging level of INFO
|
Configuration |
Configuration.logLevel(String level)
Override the default logging level of INFO
|
Configuration |
Configuration.matchersFailFast(Boolean matchersFailFast)
If true (the default) request matchers will fail on the first non-matching field, if false request matchers will compare all fields.
|
Configuration |
Configuration.maxChunkSize(Integer maxChunkSize)
Maximum size of HTTP chunks in request or responses
|
Configuration |
Configuration.maxExpectations(Integer maxExpectations)
Maximum number of expectations stored in memory.
|
Configuration |
Configuration.maxFutureTimeoutInMillis(Long maxFutureTimeoutInMillis)
Maximum time allowed in milliseconds for any future to wait, for example when waiting for a response over a web socket callback.
|
Configuration |
Configuration.maxHeaderSize(Integer maxHeaderSize)
Maximum size of HTTP request headers
|
Configuration |
Configuration.maximumNumberOfRequestToReturnInVerificationFailure(Integer maximumNumberOfRequestToReturnInVerificationFailure)
The maximum number of requests to return in verification failure result, if more expectations are found the failure result does not list them separately
|
Configuration |
Configuration.maxInitialLineLength(Integer maxInitialLineLength)
Maximum size of the first line of an HTTP request
|
Configuration |
Configuration.maxLogEntries(Integer maxLogEntries)
Maximum number of log entries stored in memory.
|
Configuration |
Configuration.maxSocketTimeoutInMillis(Long maxSocketTimeoutInMillis)
Maximum time in milliseconds allowed for a response from a socket
|
Configuration |
Configuration.maxWebSocketExpectations(Integer maxWebSocketExpectations)
Maximum number of remote (not the same JVM) method callbacks (i.e.
|
Configuration |
Configuration.memoryUsageCsvDirectory(String memoryUsageCsvDirectory)
Directory to output JVM memory usage metrics CSV files to when outputMemoryUsageCsv enabled
|
Configuration |
Configuration.metricsEnabled(Boolean metricsEnabled)
Enable gathering of metrics, default is false
|
Configuration |
Configuration.nioEventLoopThreadCount(Integer nioEventLoopThreadCount)
Netty worker thread pool size for handling requests and response.
|
Configuration |
Configuration.outputMemoryUsageCsv(Boolean outputMemoryUsageCsv)
Output JVM memory usage metrics to CSV file periodically called memoryUsage_<yyyy-MM-dd>.csv
|
Configuration |
Configuration.persistedExpectationsPath(String persistedExpectationsPath)
The file path used to save persisted expectations as json, which is updated whenever the expectation state is updated (i.e.
|
Configuration |
Configuration.persistExpectations(Boolean persistExpectations)
Enable the persisting of expectations as json, which is updated whenever the expectation state is updated (i.e.
|
Configuration |
Configuration.preventCertificateDynamicUpdate(Boolean preventCertificateDynamicUpdate)
Prevent certificates from dynamically updating when domain list changes
|
Configuration |
Configuration.privateKeyPath(String privateKeyPath)
File system path or classpath location of a fixed custom private key for TLS connections into MockServer.
|
Configuration |
Configuration.proactivelyInitialiseTLS(Boolean proactivelyInitialiseTLS)
Proactively initialise TLS during start to ensure that if dynamicallyCreateCertificateAuthorityCertificate is enabled the Certificate Authority X.509 Certificate and Private Key will be created during start up and not when the first TLS connection is received.
|
Configuration |
Configuration.proxyAuthenticationPassword(String proxyAuthenticationPassword)
The required password for proxy authentication to MockServer
|
Configuration |
Configuration.proxyAuthenticationRealm(String proxyAuthenticationRealm)
The authentication realm for proxy authentication to MockServer
|
Configuration |
Configuration.proxyAuthenticationUsername(String proxyAuthenticationUsername)
The required username for proxy authentication to MockServer
|
Configuration |
Configuration.rebuildServerTLSContext(boolean rebuildServerTLSContext) |
Configuration |
Configuration.rebuildTLSContext(boolean rebuildTLSContext) |
Configuration |
Configuration.socketConnectionTimeoutInMillis(Long socketConnectionTimeoutInMillis)
Maximum time in milliseconds allowed to connect to a socket
|
Configuration |
Configuration.sslCertificateDomainName(String sslCertificateDomainName)
The domain name for auto-generate TLS certificates
|
Configuration |
Configuration.sslSubjectAlternativeNameDomains(Set<String> sslSubjectAlternativeNameDomains)
The Subject Alternative Name (SAN) domain names for auto-generate TLS certificates
|
Configuration |
Configuration.sslSubjectAlternativeNameDomains(String... sslSubjectAlternativeNameDomains)
The Subject Alternative Name (SAN) domain names for auto-generate TLS certificates
|
Configuration |
Configuration.sslSubjectAlternativeNameIps(Set<String> sslSubjectAlternativeNameIps)
The Subject Alternative Name (SAN) IP addresses for auto-generate TLS certificates
|
Configuration |
Configuration.sslSubjectAlternativeNameIps(String... sslSubjectAlternativeNameIps)
The Subject Alternative Name (SAN) IP addresses for auto-generate TLS certificates
|
Configuration |
Configuration.tlsMutualAuthenticationCertificateChain(String tlsMutualAuthenticationCertificateChain)
File system path or classpath location of custom mTLS (TLS client authentication) X.509 Certificate Chain for trusting (i.e.
|
Configuration |
Configuration.tlsMutualAuthenticationRequired(Boolean tlsMutualAuthenticationRequired)
Require mTLS (also called client authentication and two-way TLS) for all TLS connections / HTTPS requests to MockServer
|
Configuration |
ClientConfiguration.toServerConfiguration() |
Configuration |
Configuration.useSemicolonAsQueryParameterSeparator(Boolean useSemicolonAsQueryParameterSeparator)
If true semicolons are treated as a separator for a query parameter string, if false the semicolon is treated as a normal character that is part of a query parameter value.
|
Configuration |
Configuration.watchInitializationJson(Boolean watchInitializationJson)
If enabled the initialization json file will be watched for changes, any changes found will result in expectations being created, remove or updated by matching against their key.
|
Configuration |
Configuration.webSocketClientEventLoopThreadCount(Integer webSocketClientEventLoopThreadCount)
Client Netty worker thread pool size for handling requests and response.
|
Configuration |
Configuration.x509CertificatePath(String x509CertificatePath)
File system path or classpath location of a fixed custom X.509 Certificate for TLS connections into MockServer.
|
Modifier and Type | Method and Description |
---|---|
static ClientConfiguration |
ClientConfiguration.clientConfiguration(Configuration configuration) |
Constructor and Description |
---|
ClientConfiguration(Configuration serverConfiguration) |
Modifier and Type | Method and Description |
---|---|
static boolean |
CORSHeaders.isPreflightRequest(Configuration configuration,
HttpRequest request) |
Constructor and Description |
---|
CORSHeaders(Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
static SSLContext |
UniqueCertificateChainSSLContextBuilder.uniqueCertificateChainSSLContext(Configuration configuration) |
Constructor and Description |
---|
ExampleNettySslContextFactory(Configuration configuration,
MockServerLogger mockServerLogger) |
Constructor and Description |
---|
NettyHttpClient(Configuration configuration,
MockServerLogger mockServerLogger,
io.netty.channel.EventLoopGroup eventLoopGroup,
List<ProxyConfiguration> proxyConfigurations,
boolean forwardProxyClient) |
NettyHttpClient(Configuration configuration,
MockServerLogger mockServerLogger,
io.netty.channel.EventLoopGroup eventLoopGroup,
List<ProxyConfiguration> proxyConfigurations,
boolean forwardProxyClient,
NettySslContextFactory nettySslContextFactory) |
Modifier and Type | Method and Description |
---|---|
static ClientAndServer |
ClientAndServer.startClientAndServer(Configuration configuration,
Integer... port) |
static ClientAndServer |
ClientAndServer.startClientAndServer(Configuration configuration,
List<Integer> ports) |
static ClientAndServer |
ClientAndServer.startClientAndServer(Configuration configuration,
String remoteHost,
Integer remotePort,
Integer... port) |
Constructor and Description |
---|
ClientAndServer(Configuration configuration,
Integer... ports) |
ClientAndServer(Configuration configuration,
String remoteHost,
Integer remotePort,
Integer... ports) |
Constructor and Description |
---|
LifeCycle(Configuration configuration) |
Constructor and Description |
---|
MockServerEventLog(Configuration configuration,
MockServerLogger mockServerLogger,
Scheduler scheduler,
boolean asynchronousEventProcessing) |
Constructor and Description |
---|
FullHttpRequestToMockServerHttpRequest(Configuration configuration,
MockServerLogger mockServerLogger,
boolean isSecure,
Certificate[] clientCertificates,
Integer port) |
HttpServletRequestToMockServerHttpRequestDecoder(Configuration configuration,
MockServerLogger mockServerLogger) |
Modifier and Type | Field and Description |
---|---|
protected Configuration |
AbstractHttpRequestMatcher.configuration |
Constructor and Description |
---|
AbstractHttpRequestMatcher(Configuration configuration,
MockServerLogger mockServerLogger) |
HttpRequestPropertiesMatcher(Configuration configuration,
MockServerLogger mockServerLogger) |
HttpRequestsPropertiesMatcher(Configuration configuration,
MockServerLogger mockServerLogger) |
MatcherBuilder(Configuration configuration,
MockServerLogger mockServerLogger) |
Constructor and Description |
---|
MemoryMonitoring(Configuration configuration,
MockServerEventLog mockServerLog,
RequestMatchers requestMatchers) |
Constructor and Description |
---|
Metrics(Configuration configuration) |
Constructor and Description |
---|
HttpState(Configuration configuration,
MockServerLogger mockServerLogger,
Scheduler scheduler) |
RequestMatchers(Configuration configuration,
MockServerLogger mockServerLogger,
Scheduler scheduler,
WebSocketClientRegistry webSocketClientRegistry) |
Constructor and Description |
---|
HttpActionHandler(Configuration configuration,
io.netty.channel.EventLoopGroup eventLoopGroup,
HttpState httpStateHandler,
List<ProxyConfiguration> proxyConfigurations,
NettySslContextFactory nettySslContextFactory) |
Constructor and Description |
---|
HttpRequestHandler(Configuration configuration,
LifeCycle server,
HttpState httpState,
HttpActionHandler httpActionHandler) |
MockServer(Configuration configuration,
Integer... localPorts)
Start the instance using the ports provided
|
MockServer(Configuration configuration,
Integer remotePort,
String remoteHost,
Integer... localPorts)
Start the instance using the ports provided
|
MockServer(Configuration configuration,
List<ProxyConfiguration> proxyConfigurations,
Integer... localPorts)
Start the instance using the ports provided configuring forwarded or proxied requests to go via an additional proxy
|
MockServer(Configuration configuration,
List<ProxyConfiguration> proxyConfigurations,
String remoteHost,
Integer remotePort,
Integer... localPorts)
Start the instance using the ports provided configuring forwarded or proxied requests to go via an additional proxy
|
MockServer(Configuration configuration,
ProxyConfiguration proxyConfiguration,
String remoteHost,
Integer remotePort,
Integer... localPorts)
Start the instance using the ports provided configuring forwarded or proxied requests to go via an additional proxy
|
MockServerUnificationInitializer(Configuration configuration,
LifeCycle server,
HttpState httpState,
HttpActionHandler actionHandler,
NettySslContextFactory nettySslContextFactory) |
Constructor and Description |
---|
BinaryHandler(Configuration configuration,
MockServerLogger mockServerLogger,
Scheduler scheduler,
NettyHttpClient httpClient) |
Constructor and Description |
---|
HttpConnectHandler(Configuration configuration,
LifeCycle server,
MockServerLogger mockServerLogger,
String host,
int port) |
Constructor and Description |
---|
RelayConnectHandler(Configuration configuration,
LifeCycle server,
MockServerLogger mockServerLogger,
String host,
int port) |
Modifier and Type | Field and Description |
---|---|
protected Configuration |
SocksProxyHandler.configuration |
Constructor and Description |
---|
Socks4ConnectHandler(Configuration configuration,
MockServerLogger mockServerLogger,
LifeCycle server,
String host,
int port) |
Socks4ProxyHandler(Configuration configuration,
MockServerLogger mockServerLogger,
LifeCycle server) |
Socks5ConnectHandler(Configuration configuration,
MockServerLogger mockServerLogger,
LifeCycle server,
String host,
int port) |
Socks5ProxyHandler(Configuration configuration,
MockServerLogger mockServerLogger,
LifeCycle server) |
SocksConnectHandler(Configuration configuration,
MockServerLogger mockServerLogger,
LifeCycle server,
String host,
int port) |
SocksProxyHandler(Configuration configuration,
MockServerLogger mockServerLogger,
LifeCycle server) |
Constructor and Description |
---|
NettyResponseWriter(Configuration configuration,
MockServerLogger mockServerLogger,
io.netty.channel.ChannelHandlerContext ctx,
Scheduler scheduler) |
Constructor and Description |
---|
PortUnificationHandler(Configuration configuration,
LifeCycle server,
HttpState httpState,
HttpActionHandler actionHandler,
NettySslContextFactory nettySslContextFactory) |
Constructor and Description |
---|
ExpectationFileSystemPersistence(Configuration configuration,
MockServerLogger mockServerLogger,
RequestMatchers requestMatchers) |
ExpectationFileWatcher(Configuration configuration,
MockServerLogger mockServerLogger,
RequestMatchers requestMatchers,
ExpectationInitializerLoader expectationInitializerLoader) |
Modifier and Type | Method and Description |
---|---|
static List<ProxyConfiguration> |
ProxyConfiguration.proxyConfiguration(Configuration configuration) |
Modifier and Type | Field and Description |
---|---|
protected Configuration |
ResponseWriter.configuration |
Constructor and Description |
---|
ResponseWriter(Configuration configuration,
MockServerLogger mockServerLogger) |
Constructor and Description |
---|
Scheduler(Configuration configuration,
MockServerLogger mockServerLogger) |
Scheduler(Configuration configuration,
MockServerLogger mockServerLogger,
boolean synchronous) |
Constructor and Description |
---|
ExpectationInitializerLoader(Configuration configuration,
MockServerLogger mockServerLogger,
RequestMatchers requestMatchers) |
Constructor and Description |
---|
ServletResponseWriter(Configuration configuration,
MockServerLogger mockServerLogger,
javax.servlet.http.HttpServletResponse httpServletResponse) |
Modifier and Type | Method and Description |
---|---|
static KeyAndCertificateFactory |
KeyAndCertificateFactoryFactory.createKeyAndCertificateFactory(Configuration configuration,
MockServerLogger mockServerLogger) |
Constructor and Description |
---|
KeyStoreFactory(Configuration configuration,
MockServerLogger mockServerLogger) |
NettySslContextFactory(Configuration configuration,
MockServerLogger mockServerLogger) |
SniHandler(Configuration configuration,
NettySslContextFactory nettySslContextFactory) |
Constructor and Description |
---|
BCKeyAndCertificateFactory(Configuration configuration,
MockServerLogger mockServerLogger) |
Copyright © 2022. All rights reserved.