java.lang.Object
org.kohsuke.github.WireMockMultiServerRule
org.kohsuke.github.GitHubWireMockRule
- All Implemented Interfaces:
org.junit.rules.MethodRule
,org.junit.rules.TestRule
The standard WireMockRule eagerly initializes a WireMockServer. This version suptakes a laze approach allowing us to
automatically isolate snapshots for each method.
- Author:
- Liam Newman
-
Field Summary
Fields inherited from class org.kohsuke.github.WireMockMultiServerRule
servers
-
Constructor Summary
ConstructorDescriptionInstantiates a new git hub wire mock rule.GitHubWireMockRule
(com.github.tomakehurst.wiremock.core.WireMockConfiguration options) Instantiates a new git hub wire mock rule.GitHubWireMockRule
(com.github.tomakehurst.wiremock.core.WireMockConfiguration options, boolean failOnUnmatchedRequests) Instantiates a new git hub wire mock rule. -
Method Summary
Modifier and TypeMethodDescriptioncom.github.tomakehurst.wiremock.WireMockServer
Actions user content server.protected void
after()
After.com.github.tomakehurst.wiremock.WireMockServer
Api server.protected void
before()
Before.com.github.tomakehurst.wiremock.WireMockServer
Actions user content server.com.github.tomakehurst.wiremock.WireMockServer
Codeload server.void
customizeRecordSpec
(Consumer<com.github.tomakehurst.wiremock.recording.RecordSpecBuilder> customizeRecordSpec) Customize record spec.int
Gets the request count.static int
getRequestCount
(com.github.tomakehurst.wiremock.WireMockServer server) Gets the request count.protected void
Initialize servers.boolean
Checks if is take snapshot.boolean
Checks if is test with org.boolean
Checks if is use proxy.mapToMockGitHub
(String body) Map to mock git hub.com.github.tomakehurst.wiremock.WireMockServer
Raw server.com.github.tomakehurst.wiremock.WireMockServer
Uploads server.Methods inherited from class org.kohsuke.github.WireMockMultiServerRule
apply, apply, getMethodName, initializeServer
-
Constructor Details
-
GitHubWireMockRule
public GitHubWireMockRule()Instantiates a new git hub wire mock rule. -
GitHubWireMockRule
public GitHubWireMockRule(com.github.tomakehurst.wiremock.core.WireMockConfiguration options) Instantiates a new git hub wire mock rule.- Parameters:
options
- the options
-
GitHubWireMockRule
public GitHubWireMockRule(com.github.tomakehurst.wiremock.core.WireMockConfiguration options, boolean failOnUnmatchedRequests) Instantiates a new git hub wire mock rule.- Parameters:
options
- the optionsfailOnUnmatchedRequests
- the fail on unmatched requests
-
-
Method Details
-
customizeRecordSpec
public void customizeRecordSpec(Consumer<com.github.tomakehurst.wiremock.recording.RecordSpecBuilder> customizeRecordSpec) Customize record spec.- Parameters:
customizeRecordSpec
- the customize record spec
-
apiServer
public com.github.tomakehurst.wiremock.WireMockServer apiServer()Api server.- Returns:
- the wire mock server
-
rawServer
public com.github.tomakehurst.wiremock.WireMockServer rawServer()Raw server.- Returns:
- the wire mock server
-
uploadsServer
public com.github.tomakehurst.wiremock.WireMockServer uploadsServer()Uploads server.- Returns:
- the wire mock server
-
codeloadServer
public com.github.tomakehurst.wiremock.WireMockServer codeloadServer()Codeload server.- Returns:
- the wire mock server
-
actionsUserContentServer
public com.github.tomakehurst.wiremock.WireMockServer actionsUserContentServer()Actions user content server.- Returns:
- the wire mock server
-
blobCoreWindowsNetServer
public com.github.tomakehurst.wiremock.WireMockServer blobCoreWindowsNetServer()Actions user content server.- Returns:
- the wire mock server
-
isUseProxy
public boolean isUseProxy()Checks if is use proxy.- Returns:
- true, if is use proxy
-
isTakeSnapshot
public boolean isTakeSnapshot()Checks if is take snapshot.- Returns:
- true, if is take snapshot
-
isTestWithOrg
public boolean isTestWithOrg()Checks if is test with org.- Returns:
- true, if is test with org
-
initializeServers
protected void initializeServers()Initialize servers.- Overrides:
initializeServers
in classWireMockMultiServerRule
-
before
protected void before()Before.- Overrides:
before
in classWireMockMultiServerRule
-
after
protected void after()After.- Overrides:
after
in classWireMockMultiServerRule
-
getRequestCount
public int getRequestCount()Gets the request count.- Returns:
- the request count
-
getRequestCount
public static int getRequestCount(com.github.tomakehurst.wiremock.WireMockServer server) Gets the request count.- Parameters:
server
- the server- Returns:
- the request count
-
mapToMockGitHub
Map to mock git hub.- Parameters:
body
- the body- Returns:
- the string
-