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
-
Constructor Summary
ConstructorDescriptionInstantiates 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 void
after()
After.org.junit.runners.model.Statement
apply
(org.junit.runners.model.Statement base, org.junit.runner.Description description) Apply.org.junit.runners.model.Statement
apply
(org.junit.runners.model.Statement base, org.junit.runners.model.FrameworkMethod method, Object target) Apply.protected void
before()
Before.Gets the method name.protected final void
initializeServer
(String serverId, com.github.tomakehurst.wiremock.extension.Extension... extensions) Initialize server.protected void
Initialize servers.
-
Field Details
-
servers
The servers.
-
-
Constructor Details
-
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
-
WireMockMultiServerRule
public WireMockMultiServerRule()Instantiates a new wire mock multi server rule.
-
-
Method Details
-
getMethodName
Gets the method name.- Returns:
- the method name
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description) Apply.- Specified by:
apply
in 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:
apply
in interfaceorg.junit.rules.MethodRule
- Parameters:
base
- the basemethod
- the methodtarget
- the target- Returns:
- the statement
-
initializeServers
protected void initializeServers()Initialize servers. -
initializeServer
protected final void initializeServer(String serverId, com.github.tomakehurst.wiremock.extension.Extension... extensions) Initialize server.- Parameters:
serverId
- the server idextensions
- the extensions
-
before
protected void before()Before. -
after
protected void after()After.
-