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
ConstructorsConstructorDescriptionInstantiates 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.WireMockServerActions user content server.protected voidafter()After.com.github.tomakehurst.wiremock.WireMockServerApi server.protected voidbefore()Before.com.github.tomakehurst.wiremock.WireMockServerActions user content server.com.github.tomakehurst.wiremock.WireMockServerCodeload server.voidcustomizeRecordSpec(Consumer<com.github.tomakehurst.wiremock.recording.RecordSpecBuilder> customizeRecordSpec) Customize record spec.intGets the request count.static intgetRequestCount(com.github.tomakehurst.wiremock.WireMockServer server) Gets the request count.protected voidInitialize servers.booleanChecks if is take snapshot.booleanChecks if is test with org.booleanChecks if is use proxy.mapToMockGitHub(String body) Map to mock git hub.com.github.tomakehurst.wiremock.WireMockServerRaw server.com.github.tomakehurst.wiremock.WireMockServerUploads 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
-
getRequestCount
public static int getRequestCount(com.github.tomakehurst.wiremock.WireMockServer server) Gets the request count.- Parameters:
server- the server- Returns:
- the request count
-
actionsUserContentServer
public com.github.tomakehurst.wiremock.WireMockServer actionsUserContentServer()Actions user content server.- Returns:
- the wire mock server
-
apiServer
public com.github.tomakehurst.wiremock.WireMockServer apiServer()Api server.- Returns:
- the wire mock server
-
blobCoreWindowsNetServer
public com.github.tomakehurst.wiremock.WireMockServer blobCoreWindowsNetServer()Actions user content server.- Returns:
- the wire mock server
-
codeloadServer
public com.github.tomakehurst.wiremock.WireMockServer codeloadServer()Codeload server.- Returns:
- the wire mock server
-
customizeRecordSpec
public void customizeRecordSpec(Consumer<com.github.tomakehurst.wiremock.recording.RecordSpecBuilder> customizeRecordSpec) Customize record spec.- Parameters:
customizeRecordSpec- the customize record spec
-
getRequestCount
public int getRequestCount()Gets the request count.- Returns:
- the request count
-
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
-
isUseProxy
public boolean isUseProxy()Checks if is use proxy.- Returns:
- true, if is use proxy
-
mapToMockGitHub
Map to mock git hub.- Parameters:
body- the body- Returns:
- the string
-
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
-
after
protected void after()After.- Overrides:
afterin classWireMockMultiServerRule
-
before
protected void before()Before.- Overrides:
beforein classWireMockMultiServerRule
-
initializeServers
protected void initializeServers()Initialize servers.- Overrides:
initializeServersin classWireMockMultiServerRule
-