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
ConstructorsConstructorDescriptionInstantiates 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 TypeMethodDescriptionvoidaddMockServiceRequestListener(com.github.tomakehurst.wiremock.http.RequestListener listener) Adds the mock service request listener.voidaddStubMapping(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Adds the stub mapping.protected 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.baseUrl()Base url.protected voidbefore()Before.com.github.tomakehurst.wiremock.verification.VerificationResultcountRequestsMatching(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Count requests matching.voideditStub(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Edits the stub.voideditStubMapping(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Edits the stub mapping.voidenableRecordMappings(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.ListStubMappingsResultfindAllStubsByMetadata(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.FindNearMissesResultFind near misses for unmatched requests.com.github.tomakehurst.wiremock.verification.FindRequestsResultfindRequestsMatching(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.FindNearMissesResultfindTopNearMissesFor(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Find top near misses for.com.github.tomakehurst.wiremock.verification.FindNearMissesResultfindTopNearMissesFor(com.github.tomakehurst.wiremock.verification.LoggedRequest loggedRequest) Find top near misses for.com.github.tomakehurst.wiremock.verification.FindRequestsResultFind unmatched requests.com.github.tomakehurst.wiremock.admin.model.GetScenariosResultGets the all scenarios.List<com.github.tomakehurst.wiremock.stubbing.ServeEvent>Gets the all serve events.com.github.tomakehurst.wiremock.admin.model.GetGlobalSettingsResultGets the global settings.com.github.tomakehurst.wiremock.global.GlobalSettingsHolderGets the global settings holder.Gets the method name.com.github.tomakehurst.wiremock.core.OptionsGets the options.com.github.tomakehurst.wiremock.recording.RecordingStatusResultGets the recording status.com.github.tomakehurst.wiremock.admin.model.SingleServedStubResultgetServedStub(UUID id) Gets the served stub.com.github.tomakehurst.wiremock.admin.model.GetServeEventsResultGets the serve events.com.github.tomakehurst.wiremock.admin.model.GetServeEventsResultgetServeEvents(com.github.tomakehurst.wiremock.admin.model.ServeEventQuery serveEventQuery) Gets the serve events.com.github.tomakehurst.wiremock.stubbing.StubMappingGets the single stub mapping.com.github.tomakehurst.wiremock.admin.model.SingleStubMappingResultgetStubMapping(UUID id) Gets the stub mapping.List<com.github.tomakehurst.wiremock.stubbing.StubMapping>Gets the stub mappings.com.github.tomakehurst.wiremock.stubbing.StubMappinggivenThat(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Given that.intHttps port.voidimportStubs(com.github.tomakehurst.wiremock.stubbing.StubImport stubImport) Import stubs.booleanChecks if is running.com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResultList all stub mappings.voidloadMappingsUsing(com.github.tomakehurst.wiremock.standalone.MappingsLoader mappingsLoader) Load mappings using.intport()Port.voidremoveServeEvent(UUID uuid) Removes the serve event.com.github.tomakehurst.wiremock.verification.FindServeEventsResultremoveServeEventsForStubsMatchingMetadata(com.github.tomakehurst.wiremock.matching.StringValuePattern stringValuePattern) Removes the serve events for stubs matching metadata.com.github.tomakehurst.wiremock.verification.FindServeEventsResultremoveServeEventsMatching(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Removes the serve events matching.voidremoveStub(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Removes the stub.voidremoveStub(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Removes the stub.voidremoveStubMapping(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Removes the stub mapping.voidRemoves the stub mapping.voidremoveStubMappingsByMetadata(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Removes the stub mappings by metadata.voidremoveStubsByMetadata(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Removes the stubs by metadata.voidresetAll()Reset all.voidReset mappings.voidReset requests.voidresetScenario(String name) Reset a scenariovoidReset scenarios.voidReset to default mappings.voidSave mappings.voidsetGlobalFixedDelay(int milliseconds) Sets the global fixed delay.voidsetScenarioState(String name, String state) Set scenario statevoidshutdown()Shutdown.voidShutdown server.com.github.tomakehurst.wiremock.recording.SnapshotRecordResultSnapshot record.com.github.tomakehurst.wiremock.recording.SnapshotRecordResultsnapshotRecord(com.github.tomakehurst.wiremock.recording.RecordSpec spec) Snapshot record.com.github.tomakehurst.wiremock.recording.SnapshotRecordResultsnapshotRecord(com.github.tomakehurst.wiremock.recording.RecordSpecBuilder spec) Snapshot record.voidstart()Start.voidstartRecording(com.github.tomakehurst.wiremock.recording.RecordSpec spec) Start recording.voidstartRecording(com.github.tomakehurst.wiremock.recording.RecordSpecBuilder recordSpec) Start recording.voidstartRecording(String targetBaseUrl) Start recording.voidstop()Stop.com.github.tomakehurst.wiremock.recording.SnapshotRecordResultStop recording.com.github.tomakehurst.wiremock.stubbing.StubMappingstubFor(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Stub for.voidupdateGlobalSettings(com.github.tomakehurst.wiremock.global.GlobalSettings newSettings) Update global settings.Url.voidverify(int count, com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Verify.voidverify(com.github.tomakehurst.wiremock.client.CountMatchingStrategy countMatchingStrategy, com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Verify.voidverify(com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Verify.
-
Constructor Details
-
WireMockRule
public WireMockRule()Instantiates a new wire mock rule. -
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
-
-
Method Details
-
addMockServiceRequestListener
public void addMockServiceRequestListener(com.github.tomakehurst.wiremock.http.RequestListener listener) Adds the mock service request listener.- Parameters:
listener- the listener
-
addStubMapping
public void addStubMapping(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Adds the stub mapping.- Specified by:
addStubMappingin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
stubMapping- the stub mapping
-
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
-
baseUrl
Base url.- Returns:
- the string
-
countRequestsMatching
public com.github.tomakehurst.wiremock.verification.VerificationResult countRequestsMatching(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Count requests matching.- Specified by:
countRequestsMatchingin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
requestPattern- the request pattern- Returns:
- the verification result
-
editStub
public void editStub(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Edits the stub.- Specified by:
editStubin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
mappingBuilder- the mapping builder
-
editStubMapping
public void editStubMapping(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Edits the stub mapping.- Specified by:
editStubMappingin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
stubMapping- the stub mapping
-
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
-
findAll
public List<com.github.tomakehurst.wiremock.verification.LoggedRequest> findAll(com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Find all.- Specified by:
findAllin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
requestPatternBuilder- the request pattern builder- 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:
findAllNearMissesForin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
requestPatternBuilder- the request pattern builder- Returns:
- the list
-
findAllStubsByMetadata
public com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult findAllStubsByMetadata(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Find all stubs by metadata.- Specified by:
findAllStubsByMetadatain interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
pattern- the pattern- Returns:
- the list stub mappings result
-
findAllUnmatchedRequests
Find all unmatched requests.- Specified by:
findAllUnmatchedRequestsin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- 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:
findNearMissesForin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
loggedRequest- the logged request- Returns:
- the list
-
findNearMissesForAllUnmatchedRequests
public List<com.github.tomakehurst.wiremock.verification.NearMiss> findNearMissesForAllUnmatchedRequests()Find near misses for all unmatched requests.- Specified by:
findNearMissesForAllUnmatchedRequestsin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Returns:
- the list
-
findNearMissesForUnmatchedRequests
public com.github.tomakehurst.wiremock.verification.FindNearMissesResult findNearMissesForUnmatchedRequests()Find near misses for unmatched requests.- Specified by:
findNearMissesForUnmatchedRequestsin interfacecom.github.tomakehurst.wiremock.core.Admin- Returns:
- the find near misses result
-
findRequestsMatching
public com.github.tomakehurst.wiremock.verification.FindRequestsResult findRequestsMatching(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Find requests matching.- Specified by:
findRequestsMatchingin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
requestPattern- the request pattern- Returns:
- the find requests result
-
findStubMappingsByMetadata
public List<com.github.tomakehurst.wiremock.stubbing.StubMapping> findStubMappingsByMetadata(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Find stub mappings by metadata.- Specified by:
findStubMappingsByMetadatain interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
pattern- the pattern- Returns:
- the list
-
findTopNearMissesFor
public com.github.tomakehurst.wiremock.verification.FindNearMissesResult findTopNearMissesFor(com.github.tomakehurst.wiremock.verification.LoggedRequest loggedRequest) Find top near misses for.- Specified by:
findTopNearMissesForin 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:
findTopNearMissesForin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
requestPattern- the request pattern- Returns:
- the find near misses result
-
findUnmatchedRequests
public com.github.tomakehurst.wiremock.verification.FindRequestsResult findUnmatchedRequests()Find unmatched requests.- Specified by:
findUnmatchedRequestsin interfacecom.github.tomakehurst.wiremock.core.Admin- Returns:
- the find requests result
-
getAllScenarios
public com.github.tomakehurst.wiremock.admin.model.GetScenariosResult getAllScenarios()Gets the all scenarios.- Specified by:
getAllScenariosin interfacecom.github.tomakehurst.wiremock.core.Admin- Returns:
- the all scenarios
-
getAllServeEvents
Gets the all serve events.- Specified by:
getAllServeEventsin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Returns:
- the all serve events
-
getGlobalSettings
public com.github.tomakehurst.wiremock.admin.model.GetGlobalSettingsResult getGlobalSettings()Gets the global settings.- Specified by:
getGlobalSettingsin interfacecom.github.tomakehurst.wiremock.core.Admin- Returns:
- the global settings
-
getGlobalSettingsHolder
public com.github.tomakehurst.wiremock.global.GlobalSettingsHolder getGlobalSettingsHolder()Gets the global settings holder.- Returns:
- the global settings holder
-
getMethodName
Gets the method name.- Returns:
- the method name
-
getOptions
public com.github.tomakehurst.wiremock.core.Options getOptions()Gets the options.- Specified by:
getOptionsin interfacecom.github.tomakehurst.wiremock.core.Admin- Returns:
- the options
-
getRecordingStatus
public com.github.tomakehurst.wiremock.recording.RecordingStatusResult getRecordingStatus()Gets the recording status.- Specified by:
getRecordingStatusin interfacecom.github.tomakehurst.wiremock.core.Admin- Returns:
- the recording status
-
getServeEvents
public com.github.tomakehurst.wiremock.admin.model.GetServeEventsResult getServeEvents()Gets the serve events.- Specified by:
getServeEventsin 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:
getServeEventsin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
serveEventQuery- the serve event query- Returns:
- the serve events
-
getServedStub
Gets the served stub.- Specified by:
getServedStubin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
id- the id- Returns:
- the served stub
-
getSingleStubMapping
Gets the single stub mapping.- Specified by:
getSingleStubMappingin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
id- the id- Returns:
- the single stub mapping
-
getStubMapping
Gets the stub mapping.- Specified by:
getStubMappingin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
id- the id- Returns:
- the stub mapping
-
getStubMappings
Gets the stub mappings.- Specified by:
getStubMappingsin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Returns:
- the stub mappings
-
givenThat
public com.github.tomakehurst.wiremock.stubbing.StubMapping givenThat(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Given that.- Specified by:
givenThatin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
mappingBuilder- the mapping builder- Returns:
- the stub mapping
-
httpsPort
public int httpsPort()Https port.- Returns:
- the int
-
importStubs
public void importStubs(com.github.tomakehurst.wiremock.stubbing.StubImport stubImport) Import stubs.- Specified by:
importStubsin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
stubImport- the stub import
-
isRunning
public boolean isRunning()Checks if is running.- Returns:
- true, if is running
-
listAllStubMappings
public com.github.tomakehurst.wiremock.admin.model.ListStubMappingsResult listAllStubMappings()List all stub mappings.- Specified by:
listAllStubMappingsin interfacecom.github.tomakehurst.wiremock.core.Admin- Returns:
- the list stub mappings result
-
loadMappingsUsing
public void loadMappingsUsing(com.github.tomakehurst.wiremock.standalone.MappingsLoader mappingsLoader) Load mappings using.- Parameters:
mappingsLoader- the mappings loader
-
port
public int port()Port.- Specified by:
portin interfacecom.github.tomakehurst.wiremock.core.Container- Returns:
- the int
-
removeServeEvent
Removes the serve event.- Specified by:
removeServeEventin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
uuid- the uuid
-
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:
removeServeEventsForStubsMatchingMetadatain interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
stringValuePattern- the string value pattern- Returns:
- the find serve events result
-
removeServeEventsMatching
public com.github.tomakehurst.wiremock.verification.FindServeEventsResult removeServeEventsMatching(com.github.tomakehurst.wiremock.matching.RequestPattern requestPattern) Removes the serve events matching.- Specified by:
removeServeEventsMatchingin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
requestPattern- the request pattern- Returns:
- the find serve events result
-
removeStub
public void removeStub(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Removes the stub.- Specified by:
removeStubin 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:
removeStubin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
stubMapping- the stub mapping
-
removeStubMapping
public void removeStubMapping(com.github.tomakehurst.wiremock.stubbing.StubMapping stubMapping) Removes the stub mapping.- Specified by:
removeStubMappingin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
stubMapping- the stub mapping
-
removeStubMapping
Removes the stub mapping.- Specified by:
removeStubMappingin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
id- the id
-
removeStubMappingsByMetadata
public void removeStubMappingsByMetadata(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Removes the stub mappings by metadata.- Specified by:
removeStubMappingsByMetadatain interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
pattern- the pattern
-
removeStubsByMetadata
public void removeStubsByMetadata(com.github.tomakehurst.wiremock.matching.StringValuePattern pattern) Removes the stubs by metadata.- Specified by:
removeStubsByMetadatain interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
pattern- the pattern
-
resetAll
public void resetAll()Reset all.- Specified by:
resetAllin interfacecom.github.tomakehurst.wiremock.core.Admin
-
resetMappings
public void resetMappings()Reset mappings.- Specified by:
resetMappingsin interfacecom.github.tomakehurst.wiremock.core.Admin
-
resetRequests
public void resetRequests()Reset requests.- Specified by:
resetRequestsin interfacecom.github.tomakehurst.wiremock.core.Admin
-
resetScenario
Reset a scenario- Specified by:
resetScenarioin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
name- the name
-
resetScenarios
public void resetScenarios()Reset scenarios.- Specified by:
resetScenariosin interfacecom.github.tomakehurst.wiremock.core.Admin
-
resetToDefaultMappings
public void resetToDefaultMappings()Reset to default mappings.- Specified by:
resetToDefaultMappingsin interfacecom.github.tomakehurst.wiremock.core.Admin
-
saveMappings
public void saveMappings()Save mappings.- Specified by:
saveMappingsin interfacecom.github.tomakehurst.wiremock.core.Admin
-
setGlobalFixedDelay
public void setGlobalFixedDelay(int milliseconds) Sets the global fixed delay.- Specified by:
setGlobalFixedDelayin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
milliseconds- the new global fixed delay
-
setScenarioState
Set scenario state- Specified by:
setScenarioStatein interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
name- the namestate- the state
-
shutdown
public void shutdown()Shutdown.- Specified by:
shutdownin interfacecom.github.tomakehurst.wiremock.core.Container
-
shutdownServer
public void shutdownServer()Shutdown server.- Specified by:
shutdownServerin interfacecom.github.tomakehurst.wiremock.core.Admin
-
snapshotRecord
public com.github.tomakehurst.wiremock.recording.SnapshotRecordResult snapshotRecord()Snapshot record.- Specified by:
snapshotRecordin 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.RecordSpec spec) Snapshot record.- Specified by:
snapshotRecordin 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.RecordSpecBuilder spec) Snapshot record.- Specified by:
snapshotRecordin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
spec- the spec- Returns:
- the snapshot record result
-
start
public void start()Start. -
startRecording
public void startRecording(com.github.tomakehurst.wiremock.recording.RecordSpec spec) Start recording.- Specified by:
startRecordingin 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:
startRecordingin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
recordSpec- the record spec
-
startRecording
Start recording.- Specified by:
startRecordingin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
targetBaseUrl- the target base url
-
stop
public void stop()Stop. -
stopRecording
public com.github.tomakehurst.wiremock.recording.SnapshotRecordResult stopRecording()Stop recording.- Specified by:
stopRecordingin interfacecom.github.tomakehurst.wiremock.core.Admin- Returns:
- the snapshot record result
-
stubFor
public com.github.tomakehurst.wiremock.stubbing.StubMapping stubFor(com.github.tomakehurst.wiremock.client.MappingBuilder mappingBuilder) Stub for.- Specified by:
stubForin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
mappingBuilder- the mapping builder- Returns:
- the stub mapping
-
updateGlobalSettings
public void updateGlobalSettings(com.github.tomakehurst.wiremock.global.GlobalSettings newSettings) Update global settings.- Specified by:
updateGlobalSettingsin interfacecom.github.tomakehurst.wiremock.core.Admin- Parameters:
newSettings- the new settings
-
url
Url.- Parameters:
path- the path- Returns:
- the string
-
verify
public void verify(com.github.tomakehurst.wiremock.client.CountMatchingStrategy countMatchingStrategy, com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Verify.- Specified by:
verifyin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
countMatchingStrategy- the count matching strategyrequestPatternBuilder- the request pattern builder
-
verify
public void verify(com.github.tomakehurst.wiremock.matching.RequestPatternBuilder requestPatternBuilder) Verify.- Specified by:
verifyin 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:
verifyin interfacecom.github.tomakehurst.wiremock.junit.Stubbing- Parameters:
count- the countrequestPatternBuilder- the request pattern builder
-
after
protected void after()After. -
before
protected void before()Before.
-