java.lang.Object
org.kohsuke.github.WireMockRule
- All Implemented Interfaces:
com.github.tomakehurst.wiremock.core.Admin
,com.github.tomakehurst.wiremock.core.Container
,com.github.tomakehurst.wiremock.junit.Stubbing
,org.junit.rules.MethodRule
,org.junit.rules.TestRule
public class WireMockRule
extends Object
implements org.junit.rules.MethodRule, org.junit.rules.TestRule, com.github.tomakehurst.wiremock.core.Container, com.github.tomakehurst.wiremock.junit.Stubbing, com.github.tomakehurst.wiremock.core.Admin
The Class WireMockRule.
- Author:
- Liam Newman
-
Constructor Summary
ConstructorDescriptionInstantiates a new wire mock rule.WireMockRule
(int port) Instantiates a new wire mock rule.WireMockRule
(int port, Integer httpsPort) Instantiates a new wire mock rule.WireMockRule
(com.github.tomakehurst.wiremock.core.Options options) Instantiates a new wire mock rule.WireMockRule
(com.github.tomakehurst.wiremock.core.Options options, boolean failOnUnmatchedRequests) Instantiates a new wire mock rule. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMockServiceRequestListener
(com.github.tomakehurst.wiremock.http.RequestListener listener) Adds the mock service request listener.void
addStubMapping
(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Adds the stub mapping.protected 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.baseUrl()
Base url.protected void
before()
Before.com.github.tomakehurst.wiremock.verification.VerificationResult
countRequestsMatching
(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Count requests matching.void
editStub
(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Edits the stub.void
editStubMapping
(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Edits the stub mapping.void
enableRecordMappings
(com.github.tomakehurst.wiremock.common.FileSource mappingsFileSource, com.github.tomakehurst.wiremock.common.FileSource filesFileSource) Enable record mappings.List<com.github.tomakehurst.wiremock.verification.LoggedRequest>
findAll
(com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Find all.List<com.github.tomakehurst.wiremock.verification.NearMiss>
findAllNearMissesFor
(com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Find all near misses for.com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult
findAllStubsByMetadata
(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Find all stubs by metadata.List<com.github.tomakehurst.wiremock.verification.LoggedRequest>
Find all unmatched requests.List<com.github.tomakehurst.wiremock.verification.NearMiss>
findNearMissesFor
(com.github.tomakehurst.wiremock.verification.LoggedRequest loggedRequest) Find near misses for.List<com.github.tomakehurst.wiremock.verification.NearMiss>
Find near misses for all unmatched requests.com.github.tomakehurst.wiremock.verification.FindNearMissesResult
Find near misses for unmatched requests.com.github.tomakehurst.wiremock.verification.FindRequestsResult
findRequestsMatching
(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Find requests matching.List<com.github.tomakehurst.wiremock.stubbing.StubMapping>
findStubMappingsByMetadata
(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Find stub mappings by metadata.com.github.tomakehurst.wiremock.verification.FindNearMissesResult
findTopNearMissesFor
(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Find top near misses for.com.github.tomakehurst.wiremock.verification.FindNearMissesResult
findTopNearMissesFor
(com.github.tomakehurst.wiremock.verification.LoggedRequest loggedRequest) Find top near misses for.com.github.tomakehurst.wiremock.verification.FindRequestsResult
Find unmatched requests.com.github.tomakehurst.wiremock.admin.model.GetScenariosResult
Gets the all scenarios.List<com.github.tomakehurst.wiremock.stubbing.ServeEvent>
Gets the all serve events.com.github.tomakehurst.wiremock.admin.model.GetGlobalSettingsResult
Gets the global settings.com.github.tomakehurst.wiremock.global.GlobalSettingsHolder
Gets the global settings holder.Gets the method name.com.github.tomakehurst.wiremock.core.Options
Gets the options.com.github.tomakehurst.wiremock.recording.RecordingStatusResult
Gets the recording status.com.github.tomakehurst.wiremock.admin.model.SingleServedStubResult
getServedStub
(UUID id) Gets the served stub.com.github.tomakehurst.wiremock.admin.model.GetServeEventsResult
Gets the serve events.com.github.tomakehurst.wiremock.admin.model.GetServeEventsResult
getServeEvents
(com.github.tomakehurst.wiremock.admin.model.ServeEventQuery serveEventQuery) Gets the serve events.com.github.tomakehurst.wiremock.stubbing.StubMapping
Gets the single stub mapping.com.github.tomakehurst.wiremock.admin.model.SingleStubMappingResult
getStubMapping
(UUID id) Gets the stub mapping.List<com.github.tomakehurst.wiremock.stubbing.StubMapping>
Gets the stub mappings.com.github.tomakehurst.wiremock.stubbing.StubMapping
givenThat
(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Given that.int
Https port.void
importStubs
(com.github.tomakehurst.wiremock.stubbing.StubImport stubImport) Import stubs.boolean
Checks if is running.com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult
List all stub mappings.void
loadMappingsUsing
(com.github.tomakehurst.wiremock.standalone.MappingsLoader mappingsLoader) Load mappings using.int
port()
Port.void
removeServeEvent
(UUID uuid) Removes the serve event.com.github.tomakehurst.wiremock.verification.FindServeEventsResult
removeServeEventsForStubsMatchingMetadata
(com.github.tomakehurst.wiremock.matching.StringValuePattern stringValuePattern) Removes the serve events for stubs matching metadata.com.github.tomakehurst.wiremock.verification.FindServeEventsResult
removeServeEventsMatching
(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Removes the serve events matching.void
removeStub
(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Removes the stub.void
removeStub
(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Removes the stub.void
removeStubMapping
(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Removes the stub mapping.void
Removes the stub mapping.void
removeStubMappingsByMetadata
(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Removes the stub mappings by metadata.void
removeStubsByMetadata
(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Removes the stubs by metadata.void
resetAll()
Reset all.void
Reset mappings.void
Reset requests.void
resetScenario
(String name) Reset a scenariovoid
Reset scenarios.void
Reset to default mappings.void
Save mappings.void
setGlobalFixedDelay
(int milliseconds) Sets the global fixed delay.void
setScenarioState
(String name, String state) Set scenario statevoid
shutdown()
Shutdown.void
Shutdown server.com.github.tomakehurst.wiremock.recording.SnapshotRecordResult
Snapshot record.com.github.tomakehurst.wiremock.recording.SnapshotRecordResult
snapshotRecord
(com.github.tomakehurst.wiremock.recording.RecordSpec spec) Snapshot record.com.github.tomakehurst.wiremock.recording.SnapshotRecordResult
snapshotRecord
(com.github.tomakehurst.wiremock.recording.RecordSpecBuilder spec) Snapshot record.void
start()
Start.void
startRecording
(com.github.tomakehurst.wiremock.recording.RecordSpec spec) Start recording.void
startRecording
(com.github.tomakehurst.wiremock.recording.RecordSpecBuilder recordSpec) Start recording.void
startRecording
(String targetBaseUrl) Start recording.void
stop()
Stop.com.github.tomakehurst.wiremock.recording.SnapshotRecordResult
Stop recording.com.github.tomakehurst.wiremock.stubbing.StubMapping
stubFor
(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Stub for.void
updateGlobalSettings
(com.github.tomakehurst.wiremock.global.GlobalSettings newSettings) Update global settings.Url.void
verify
(int count, com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Verify.void
verify
(com.github.tomakehurst.wiremock.client.CountMatchingStrategy countMatchingStrategy, com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Verify.void
verify
(com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Verify.
-
Constructor Details
-
WireMockRule
public WireMockRule(com.github.tomakehurst.wiremock.core.Options options) Instantiates a new wire mock rule.- Parameters:
options
- the options
-
WireMockRule
public WireMockRule(com.github.tomakehurst.wiremock.core.Options options, boolean failOnUnmatchedRequests) Instantiates a new wire mock rule.- Parameters:
options
- the optionsfailOnUnmatchedRequests
- the fail on unmatched requests
-
WireMockRule
public WireMockRule(int port) Instantiates a new wire mock rule.- Parameters:
port
- the port
-
WireMockRule
Instantiates a new wire mock rule.- Parameters:
port
- the porthttpsPort
- the https port
-
WireMockRule
public WireMockRule()Instantiates a new wire mock 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
-
before
protected void before()Before. -
after
protected void after()After. -
loadMappingsUsing
public void loadMappingsUsing(com.github.tomakehurst.wiremock.standalone.MappingsLoader mappingsLoader) Load mappings using.- Parameters:
mappingsLoader
- the mappings loader
-
getGlobalSettingsHolder
public com.github.tomakehurst.wiremock.global.GlobalSettingsHolder getGlobalSettingsHolder()Gets the global settings holder.- Returns:
- the global settings holder
-
addMockServiceRequestListener
public void addMockServiceRequestListener(com.github.tomakehurst.wiremock.http.RequestListener listener) Adds the mock service request listener.- Parameters:
listener
- the listener
-
enableRecordMappings
public void enableRecordMappings(com.github.tomakehurst.wiremock.common.FileSource mappingsFileSource, com.github.tomakehurst.wiremock.common.FileSource filesFileSource) Enable record mappings.- Parameters:
mappingsFileSource
- the mappings file sourcefilesFileSource
- the files file source
-
stop
public void stop()Stop. -
start
public void start()Start. -
shutdown
public void shutdown()Shutdown.- Specified by:
shutdown
in interfacecom.github.tomakehurst.wiremock.core.Container
-
port
public int port()Port.- Specified by:
port
in interfacecom.github.tomakehurst.wiremock.core.Container
- Returns:
- the int
-
httpsPort
public int httpsPort()Https port.- Returns:
- the int
-
url
Url.- Parameters:
path
- the path- Returns:
- the string
-
baseUrl
Base url.- Returns:
- the string
-
isRunning
public boolean isRunning()Checks if is running.- Returns:
- true, if is running
-
givenThat
public com.github.tomakehurst.wiremock.stubbing.StubMapping givenThat(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Given that.- Specified by:
givenThat
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
mappingBuilder
- the mapping builder- Returns:
- the stub mapping
-
stubFor
public com.github.tomakehurst.wiremock.stubbing.StubMapping stubFor(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Stub for.- Specified by:
stubFor
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
mappingBuilder
- the mapping builder- Returns:
- the stub mapping
-
editStub
public void editStub(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Edits the stub.- Specified by:
editStub
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
mappingBuilder
- the mapping builder
-
removeStub
public void removeStub(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Removes the stub.- Specified by:
removeStub
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
mappingBuilder
- the mapping builder
-
removeStub
public void removeStub(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Removes the stub.- Specified by:
removeStub
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
stubMapping
- the stub mapping
-
getStubMappings
Gets the stub mappings.- Specified by:
getStubMappings
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Returns:
- the stub mappings
-
getSingleStubMapping
Gets the single stub mapping.- Specified by:
getSingleStubMapping
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
id
- the id- Returns:
- the single stub mapping
-
findStubMappingsByMetadata
public List<com.github.tomakehurst.wiremock.stubbing.StubMapping> findStubMappingsByMetadata(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Find stub mappings by metadata.- Specified by:
findStubMappingsByMetadata
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
pattern
- the pattern- Returns:
- the list
-
removeStubMappingsByMetadata
public void removeStubMappingsByMetadata(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Removes the stub mappings by metadata.- Specified by:
removeStubMappingsByMetadata
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
pattern
- the pattern
-
removeStubMapping
public void removeStubMapping(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Removes the stub mapping.- Specified by:
removeStubMapping
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
stubMapping
- the stub mapping
-
verify
public void verify(com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Verify.- Specified by:
verify
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
requestPatternBuilder
- the request pattern builder
-
verify
public void verify(int count, com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Verify.- Specified by:
verify
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
count
- the countrequestPatternBuilder
- the request pattern builder
-
verify
public void verify(com.github.tomakehurst.wiremock.client.CountMatchingStrategy countMatchingStrategy, com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Verify.- Specified by:
verify
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
countMatchingStrategy
- the count matching strategyrequestPatternBuilder
- the request pattern builder
-
findAll
public List<com.github.tomakehurst.wiremock.verification.LoggedRequest> findAll(com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Find all.- Specified by:
findAll
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
requestPatternBuilder
- the request pattern builder- Returns:
- the list
-
getAllServeEvents
Gets the all serve events.- Specified by:
getAllServeEvents
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Returns:
- the all serve events
-
setGlobalFixedDelay
public void setGlobalFixedDelay(int milliseconds) Sets the global fixed delay.- Specified by:
setGlobalFixedDelay
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
milliseconds
- the new global fixed delay
-
findAllUnmatchedRequests
Find all unmatched requests.- Specified by:
findAllUnmatchedRequests
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Returns:
- the list
-
findNearMissesForAllUnmatchedRequests
public List<com.github.tomakehurst.wiremock.verification.NearMiss> findNearMissesForAllUnmatchedRequests()Find near misses for all unmatched requests.- Specified by:
findNearMissesForAllUnmatchedRequests
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Returns:
- the list
-
findAllNearMissesFor
public List<com.github.tomakehurst.wiremock.verification.NearMiss> findAllNearMissesFor(com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Find all near misses for.- Specified by:
findAllNearMissesFor
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
requestPatternBuilder
- the request pattern builder- Returns:
- the list
-
findNearMissesFor
public List<com.github.tomakehurst.wiremock.verification.NearMiss> findNearMissesFor(com.github.tomakehurst.wiremock.verification.LoggedRequest loggedRequest) Find near misses for.- Specified by:
findNearMissesFor
in interfacecom.github.tomakehurst.wiremock.junit.Stubbing
- Parameters:
loggedRequest
- the logged request- Returns:
- the list
-
addStubMapping
public void addStubMapping(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Adds the stub mapping.- Specified by:
addStubMapping
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
stubMapping
- the stub mapping
-
editStubMapping
public void editStubMapping(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Edits the stub mapping.- Specified by:
editStubMapping
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
stubMapping
- the stub mapping
-
removeStubMapping
Removes the stub mapping.- Specified by:
removeStubMapping
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
id
- the id
-
listAllStubMappings
public com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult listAllStubMappings()List all stub mappings.- Specified by:
listAllStubMappings
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Returns:
- the list stub mappings result
-
getStubMapping
Gets the stub mapping.- Specified by:
getStubMapping
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
id
- the id- Returns:
- the stub mapping
-
saveMappings
public void saveMappings()Save mappings.- Specified by:
saveMappings
in interfacecom.github.tomakehurst.wiremock.core.Admin
-
resetAll
public void resetAll()Reset all.- Specified by:
resetAll
in interfacecom.github.tomakehurst.wiremock.core.Admin
-
resetRequests
public void resetRequests()Reset requests.- Specified by:
resetRequests
in interfacecom.github.tomakehurst.wiremock.core.Admin
-
resetToDefaultMappings
public void resetToDefaultMappings()Reset to default mappings.- Specified by:
resetToDefaultMappings
in interfacecom.github.tomakehurst.wiremock.core.Admin
-
getServeEvents
public com.github.tomakehurst.wiremock.admin.model.GetServeEventsResult getServeEvents()Gets the serve events.- Specified by:
getServeEvents
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Returns:
- the serve events
-
getServeEvents
public com.github.tomakehurst.wiremock.admin.model.GetServeEventsResult getServeEvents(com.github.tomakehurst.wiremock.admin.model.ServeEventQuery serveEventQuery) Gets the serve events.- Specified by:
getServeEvents
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
serveEventQuery
- the serve event query- Returns:
- the serve events
-
getServedStub
Gets the served stub.- Specified by:
getServedStub
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
id
- the id- Returns:
- the served stub
-
resetScenarios
public void resetScenarios()Reset scenarios.- Specified by:
resetScenarios
in interfacecom.github.tomakehurst.wiremock.core.Admin
-
resetMappings
public void resetMappings()Reset mappings.- Specified by:
resetMappings
in interfacecom.github.tomakehurst.wiremock.core.Admin
-
countRequestsMatching
public com.github.tomakehurst.wiremock.verification.VerificationResult countRequestsMatching(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Count requests matching.- Specified by:
countRequestsMatching
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
requestPattern
- the request pattern- Returns:
- the verification result
-
findRequestsMatching
public com.github.tomakehurst.wiremock.verification.FindRequestsResult findRequestsMatching(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Find requests matching.- Specified by:
findRequestsMatching
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
requestPattern
- the request pattern- Returns:
- the find requests result
-
findUnmatchedRequests
public com.github.tomakehurst.wiremock.verification.FindRequestsResult findUnmatchedRequests()Find unmatched requests.- Specified by:
findUnmatchedRequests
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Returns:
- the find requests result
-
removeServeEvent
Removes the serve event.- Specified by:
removeServeEvent
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
uuid
- the uuid
-
removeServeEventsMatching
public com.github.tomakehurst.wiremock.verification.FindServeEventsResult removeServeEventsMatching(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Removes the serve events matching.- Specified by:
removeServeEventsMatching
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
requestPattern
- the request pattern- Returns:
- the find serve events result
-
removeServeEventsForStubsMatchingMetadata
public com.github.tomakehurst.wiremock.verification.FindServeEventsResult removeServeEventsForStubsMatchingMetadata(com.github.tomakehurst.wiremock.matching.StringValuePattern stringValuePattern) Removes the serve events for stubs matching metadata.- Specified by:
removeServeEventsForStubsMatchingMetadata
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
stringValuePattern
- the string value pattern- Returns:
- the find serve events result
-
updateGlobalSettings
public void updateGlobalSettings(com.github.tomakehurst.wiremock.global.GlobalSettings newSettings) Update global settings.- Specified by:
updateGlobalSettings
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
newSettings
- the new settings
-
findNearMissesForUnmatchedRequests
public com.github.tomakehurst.wiremock.verification.FindNearMissesResult findNearMissesForUnmatchedRequests()Find near misses for unmatched requests.- Specified by:
findNearMissesForUnmatchedRequests
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Returns:
- the find near misses result
-
getAllScenarios
public com.github.tomakehurst.wiremock.admin.model.GetScenariosResult getAllScenarios()Gets the all scenarios.- Specified by:
getAllScenarios
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Returns:
- the all scenarios
-
resetScenario
Reset a scenario- Specified by:
resetScenario
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
name
- the name
-
setScenarioState
Set scenario state- Specified by:
setScenarioState
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
name
- the namestate
- the state
-
findTopNearMissesFor
public com.github.tomakehurst.wiremock.verification.FindNearMissesResult findTopNearMissesFor(com.github.tomakehurst.wiremock.verification.LoggedRequest loggedRequest) Find top near misses for.- Specified by:
findTopNearMissesFor
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
loggedRequest
- the logged request- Returns:
- the find near misses result
-
findTopNearMissesFor
public com.github.tomakehurst.wiremock.verification.FindNearMissesResult findTopNearMissesFor(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Find top near misses for.- Specified by:
findTopNearMissesFor
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
requestPattern
- the request pattern- Returns:
- the find near misses result
-
startRecording
Start recording.- Specified by:
startRecording
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
targetBaseUrl
- the target base url
-
startRecording
public void startRecording(com.github.tomakehurst.wiremock.recording.RecordSpec spec) Start recording.- Specified by:
startRecording
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
spec
- the spec
-
startRecording
public void startRecording(com.github.tomakehurst.wiremock.recording.RecordSpecBuilder recordSpec) Start recording.- Specified by:
startRecording
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
recordSpec
- the record spec
-
stopRecording
public com.github.tomakehurst.wiremock.recording.SnapshotRecordResult stopRecording()Stop recording.- Specified by:
stopRecording
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Returns:
- the snapshot record result
-
getRecordingStatus
public com.github.tomakehurst.wiremock.recording.RecordingStatusResult getRecordingStatus()Gets the recording status.- Specified by:
getRecordingStatus
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Returns:
- the recording status
-
snapshotRecord
public com.github.tomakehurst.wiremock.recording.SnapshotRecordResult snapshotRecord()Snapshot record.- Specified by:
snapshotRecord
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Returns:
- the snapshot record result
-
snapshotRecord
public com.github.tomakehurst.wiremock.recording.SnapshotRecordResult snapshotRecord(com.github.tomakehurst.wiremock.recording.RecordSpecBuilder spec) Snapshot record.- Specified by:
snapshotRecord
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
spec
- the spec- Returns:
- the snapshot record result
-
snapshotRecord
public com.github.tomakehurst.wiremock.recording.SnapshotRecordResult snapshotRecord(com.github.tomakehurst.wiremock.recording.RecordSpec spec) Snapshot record.- Specified by:
snapshotRecord
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
spec
- the spec- Returns:
- the snapshot record result
-
getOptions
public com.github.tomakehurst.wiremock.core.Options getOptions()Gets the options.- Specified by:
getOptions
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Returns:
- the options
-
shutdownServer
public void shutdownServer()Shutdown server.- Specified by:
shutdownServer
in interfacecom.github.tomakehurst.wiremock.core.Admin
-
findAllStubsByMetadata
public com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult findAllStubsByMetadata(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Find all stubs by metadata.- Specified by:
findAllStubsByMetadata
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
pattern
- the pattern- Returns:
- the list stub mappings result
-
removeStubsByMetadata
public void removeStubsByMetadata(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Removes the stubs by metadata.- Specified by:
removeStubsByMetadata
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
pattern
- the pattern
-
importStubs
public void importStubs(com.github.tomakehurst.wiremock.stubbing.StubImport stubImport) Import stubs.- Specified by:
importStubs
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Parameters:
stubImport
- the stub import
-
getGlobalSettings
public com.github.tomakehurst.wiremock.admin.model.GetGlobalSettingsResult getGlobalSettings()Gets the global settings.- Specified by:
getGlobalSettings
in interfacecom.github.tomakehurst.wiremock.core.Admin
- Returns:
- the global settings
-