java.lang.Object
org.kohsuke.github.WireMockMultiServerRule
- All Implemented Interfaces:
org.junit.rules.MethodRule,org.junit.rules.TestRule
- Direct Known Subclasses:
GitHubWireMockRule
public class WireMockMultiServerRule
extends Object
implements org.junit.rules.MethodRule, org.junit.rules.TestRule
The standard WireMockRule eagerly initializes a WireMockServer. This version supports multiple servers in one rule
and takes a lazy approach to intitialization allowing us to isolate files snapshots for each method.
- Author:
- Liam Newman
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new wire mock multi server rule.WireMockMultiServerRule(com.github.tomakehurst.wiremock.core.Options options) Instantiates a new wire mock multi server rule.WireMockMultiServerRule(com.github.tomakehurst.wiremock.core.Options options, boolean failOnUnmatchedRequests) Instantiates a new wire mock multi server rule. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafter()After.org.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runner.Description description) Apply.org.junit.runners.model.Statementapply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target) Apply.protected voidbefore()Before.Gets the method name.protected final voidinitializeServer(String serverId, com.github.tomakehurst.wiremock.extension.Extension... extensions) Initialize server.protected voidInitialize servers.
-
Field Details
-
servers
The servers.
-
-
Constructor Details
-
WireMockMultiServerRule
public WireMockMultiServerRule()Instantiates a new wire mock multi server rule. -
WireMockMultiServerRule
public WireMockMultiServerRule(com.github.tomakehurst.wiremock.core.Options options) Instantiates a new wire mock multi server rule.- Parameters:
options- the options
-
WireMockMultiServerRule
public WireMockMultiServerRule(com.github.tomakehurst.wiremock.core.Options options, boolean failOnUnmatchedRequests) Instantiates a new wire mock multi server rule.- Parameters:
options- the optionsfailOnUnmatchedRequests- the fail on unmatched requests
-
-
Method Details
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description) Apply.- Specified by:
applyin interfaceorg.junit.rules.TestRule- Parameters:
base- the basedescription- the description- Returns:
- the statement
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target) Apply.- Specified by:
applyin interfaceorg.junit.rules.MethodRule- Parameters:
base- the basemethod- the methodtarget- the target- Returns:
- the statement
-
getMethodName
Gets the method name.- Returns:
- the method name
-
after
protected void after()After. -
before
protected void before()Before. -
initializeServer
protected final void initializeServer(String serverId, com.github.tomakehurst.wiremock.extension.Extension... extensions) Initialize server.- Parameters:
serverId- the server idextensions- the extensions
-
initializeServers
protected void initializeServers()Initialize servers.
-