public abstract class MockServerAbstractMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
compileClasspath
The main classpath location of the project using this plugin
|
protected List<org.apache.maven.model.Dependency> |
dependencies
The plugin dependencies
|
protected String |
initializationClass
To enable the creation of default expectations that are generic across all tests or mocking scenarios a class can be specified
to initialize expectations in the MockServer, this class must implement org.mockserver.initialize.PluginExpectationInitializer interface,
the initializeExpectations(MockServerClient mockServerClient) method will be called once the MockServer has been started (but ONLY
if serverPort has been set), however it should be noted that it is generally better practice to create all expectations locally in
each test (or test class) for clarity, simplicity and to avoid brittle tests
|
protected String |
initializationJson
To enable the creation of default expectations that are generic across all tests or mocking scenarios a json filed can be specified
to initialize expectations in the MockServer.
|
protected static InstanceHolder |
instanceHolder
Holds reference to jetty across plugin execution
|
protected String |
logLevel
Optionally specify log level as TRACE, DEBUG, INFO, WARN, ERROR or
OFF.
|
protected boolean |
pipeLogToConsole
If true the console of the forked JVM will be piped to the Maven console
|
protected String |
proxyRemoteHost
Specified the host to forward all proxy requests to when port
forwarding mode has been enabled using the proxyRemotePort option.
|
protected Integer |
proxyRemotePort
Optionally enables port forwarding mode.
|
protected String |
serverPort
The HTTP, HTTPS, SOCKS and HTTP CONNECT port for the MockServer
for both mocking and proxying requests.
|
protected boolean |
skip
Skip the plugin execution completely
|
protected List<String> |
testClasspath
The test classpath location of the project using this plugin
|
protected Integer |
timeout
Timeout to wait before stopping MockServer, to run MockServer indefinitely do not set a value
|
| Constructor and Description |
|---|
MockServerAbstractMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected org.mockserver.client.initialize.ExpectationInitializer |
createInitializerClass() |
protected String |
createInitializerJson() |
protected InstanceHolder |
getLocalMockServerInstance() |
static void |
mockServerPort(Integer... port) |
getLog, getPluginContext, setLog, setPluginContextprotected static InstanceHolder instanceHolder
@Parameter(property="mockserver.serverPort") protected String serverPort
@Parameter(property="mockserver.proxyRemotePort",
defaultValue="-1")
protected Integer proxyRemotePort
@Parameter(property="mockserver.proxyRemoteHost") protected String proxyRemoteHost
@Parameter(property="mockserver.timeout") protected Integer timeout
@Parameter(property="mockserver.logLevel",
defaultValue="INFO")
protected String logLevel
@Parameter(property="mockserver.skip",
defaultValue="false")
protected boolean skip
@Parameter(property="mockserver.pipeLogToConsole",
defaultValue="false")
protected boolean pipeLogToConsole
@Parameter(property="mockserver.initializationClass") protected String initializationClass
@Parameter(property="mockserver.initializationJson") protected String initializationJson
@Parameter(property="project.compileClasspathElements",
required=true,
readonly=true)
protected List<String> compileClasspath
@Parameter(property="project.testClasspathElements",
required=true,
readonly=true)
protected List<String> testClasspath
@Parameter(property="pluginDescriptor.plugin.dependencies",
required=true,
readonly=true)
protected List<org.apache.maven.model.Dependency> dependencies
protected InstanceHolder getLocalMockServerInstance()
protected org.mockserver.client.initialize.ExpectationInitializer createInitializerClass()
protected String createInitializerJson()
public static void mockServerPort(Integer... port)
Copyright © 2023. All rights reserved.