Package com.github.tomakehurst.wiremock
Class WireMockServer
java.lang.Object
com.github.tomakehurst.wiremock.WireMockServer
- Direct Known Subclasses:
WireMockClassRule,WireMockRule
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWireMockServer(int port) WireMockServer(int port, FileSource fileSource, boolean enableBrowserProxying) WireMockServer(int port, FileSource fileSource, boolean enableBrowserProxying, ProxySettings proxySettings) WireMockServer(int port, Integer httpsPort) WireMockServer(int port, Integer httpsPort, FileSource fileSource, boolean enableBrowserProxying, ProxySettings proxySettings, Notifier notifier) WireMockServer(Options options) WireMockServer(String filenameTemplate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMockServiceRequestListener(RequestListener listener) voidaddStubMapping(StubMapping stubMapping) baseUrl()voidcountRequestsMatching(RequestPattern requestPattern) voideditStub(MappingBuilder mappingBuilder) voideditStubMapping(StubMapping stubMapping) voidenableRecordMappings(FileSource mappingsFileSource, FileSource filesFileSource) findAll(RequestPatternBuilder requestPatternBuilder) findAllNearMissesFor(RequestPatternBuilder requestPatternBuilder) findAllStubsByMetadata(StringValuePattern pattern) findNearMissesFor(LoggedRequest loggedRequest) findRequestsMatching(RequestPattern requestPattern) findTopNearMissesFor(RequestPattern requestPattern) findTopNearMissesFor(LoggedRequest loggedRequest) getServedStub(UUID id) getServeEvents(ServeEventQuery query) getStubMapping(UUID id) givenThat(MappingBuilder mappingBuilder) intvoidimportStubs(StubImport stubImport) booleanbooleanbooleanvoidloadMappingsUsing(MappingsLoader mappingsLoader) intport()voidremoveServeEvent(UUID eventId) removeServeEventsForStubsMatchingMetadata(StringValuePattern metadataPattern) removeServeEventsMatching(RequestPattern requestPattern) voidremoveStub(MappingBuilder mappingBuilder) voidremoveStub(StubMapping stubMapping) voidremoveStub(UUID id) voidremoveStubMapping(StubMapping stubMapping) voidvoidvoidremoveStubsByMetadata(StringValuePattern pattern) voidresetAll()voidvoidvoidresetScenario(String name) voidvoidvoidvoidsetGlobalFixedDelay(int milliseconds) voidsetScenarioState(String name, String state) voidshutdown()Gracefully shutdown the server.voidsnapshotRecord(RecordSpec spec) voidstart()voidstartRecording(RecordSpec spec) voidstartRecording(RecordSpecBuilder recordSpec) voidstartRecording(String targetBaseUrl) voidstop()stubFor(MappingBuilder mappingBuilder) voidupdateGlobalSettings(GlobalSettings newSettings) voidverify(int count, RequestPatternBuilder requestPatternBuilder) voidverify(CountMatchingStrategy countMatchingStrategy, RequestPatternBuilder requestPatternBuilder) voidverify(RequestPatternBuilder requestPatternBuilder)
-
Field Details
-
options
-
client
-
-
Constructor Details
-
WireMockServer
-
WireMockServer
public WireMockServer(int port, Integer httpsPort, FileSource fileSource, boolean enableBrowserProxying, ProxySettings proxySettings, Notifier notifier) -
WireMockServer
public WireMockServer(int port, FileSource fileSource, boolean enableBrowserProxying, ProxySettings proxySettings) -
WireMockServer
-
WireMockServer
public WireMockServer(int port) -
WireMockServer
-
WireMockServer
public WireMockServer() -
WireMockServer
-
-
Method Details
-
loadMappingsUsing
-
addMockServiceRequestListener
-
enableRecordMappings
-
stop
public void stop() -
start
public void start() -
shutdown
public void shutdown()Gracefully shutdown the server.This method assumes it is being called as the result of an incoming HTTP request.
-
isHttpEnabled
public boolean isHttpEnabled() -
isHttpsEnabled
public boolean isHttpsEnabled() -
port
public int port() -
httpsPort
public int httpsPort() -
url
-
baseUrl
-
isRunning
public boolean isRunning() -
givenThat
-
stubFor
-
editStub
-
removeStub
- Specified by:
removeStubin interfaceStubbing
-
removeStub
- Specified by:
removeStubin interfaceStubbing
-
removeStub
- Specified by:
removeStubin interfaceStubbing
-
getStubMappings
- Specified by:
getStubMappingsin interfaceStubbing
-
getSingleStubMapping
- Specified by:
getSingleStubMappingin interfaceStubbing
-
findStubMappingsByMetadata
- Specified by:
findStubMappingsByMetadatain interfaceStubbing
-
removeStubMappingsByMetadata
- Specified by:
removeStubMappingsByMetadatain interfaceStubbing
-
removeStubMapping
- Specified by:
removeStubMappingin interfaceAdmin
-
removeStubMapping
- Specified by:
removeStubMappingin interfaceAdmin
-
verify
-
verify
-
verify
public void verify(CountMatchingStrategy countMatchingStrategy, RequestPatternBuilder requestPatternBuilder) -
findAll
-
getAllServeEvents
- Specified by:
getAllServeEventsin interfaceStubbing
-
setGlobalFixedDelay
public void setGlobalFixedDelay(int milliseconds) - Specified by:
setGlobalFixedDelayin interfaceStubbing
-
findAllUnmatchedRequests
- Specified by:
findAllUnmatchedRequestsin interfaceStubbing
-
findNearMissesForAllUnmatchedRequests
- Specified by:
findNearMissesForAllUnmatchedRequestsin interfaceStubbing
-
findAllNearMissesFor
- Specified by:
findAllNearMissesForin interfaceStubbing
-
findNearMissesFor
- Specified by:
findNearMissesForin interfaceStubbing
-
addStubMapping
- Specified by:
addStubMappingin interfaceAdmin
-
editStubMapping
- Specified by:
editStubMappingin interfaceAdmin
-
listAllStubMappings
- Specified by:
listAllStubMappingsin interfaceAdmin
-
getStubMapping
- Specified by:
getStubMappingin interfaceAdmin
-
saveMappings
public void saveMappings()- Specified by:
saveMappingsin interfaceAdmin
-
resetAll
public void resetAll() -
resetRequests
public void resetRequests()- Specified by:
resetRequestsin interfaceAdmin
-
resetToDefaultMappings
public void resetToDefaultMappings()- Specified by:
resetToDefaultMappingsin interfaceAdmin
-
getServeEvents
- Specified by:
getServeEventsin interfaceAdmin
-
getServeEvents
- Specified by:
getServeEventsin interfaceAdmin
-
getServedStub
- Specified by:
getServedStubin interfaceAdmin
-
resetScenarios
public void resetScenarios()- Specified by:
resetScenariosin interfaceAdmin
-
resetMappings
public void resetMappings()- Specified by:
resetMappingsin interfaceAdmin
-
countRequestsMatching
- Specified by:
countRequestsMatchingin interfaceAdmin
-
findRequestsMatching
- Specified by:
findRequestsMatchingin interfaceAdmin
-
findUnmatchedRequests
- Specified by:
findUnmatchedRequestsin interfaceAdmin
-
removeServeEvent
- Specified by:
removeServeEventin interfaceAdmin
-
removeServeEventsMatching
- Specified by:
removeServeEventsMatchingin interfaceAdmin
-
removeServeEventsForStubsMatchingMetadata
public FindServeEventsResult removeServeEventsForStubsMatchingMetadata(StringValuePattern metadataPattern) - Specified by:
removeServeEventsForStubsMatchingMetadatain interfaceAdmin
-
updateGlobalSettings
- Specified by:
updateGlobalSettingsin interfaceAdmin
-
findNearMissesForUnmatchedRequests
- Specified by:
findNearMissesForUnmatchedRequestsin interfaceAdmin
-
getAllScenarios
- Specified by:
getAllScenariosin interfaceAdmin
-
resetScenario
- Specified by:
resetScenarioin interfaceAdmin
-
setScenarioState
- Specified by:
setScenarioStatein interfaceAdmin
-
findTopNearMissesFor
- Specified by:
findTopNearMissesForin interfaceAdmin
-
findTopNearMissesFor
- Specified by:
findTopNearMissesForin interfaceAdmin
-
startRecording
- Specified by:
startRecordingin interfaceAdmin
-
startRecording
- Specified by:
startRecordingin interfaceAdmin
-
startRecording
- Specified by:
startRecordingin interfaceAdmin
-
stopRecording
- Specified by:
stopRecordingin interfaceAdmin
-
getRecordingStatus
- Specified by:
getRecordingStatusin interfaceAdmin
-
snapshotRecord
- Specified by:
snapshotRecordin interfaceAdmin
-
snapshotRecord
- Specified by:
snapshotRecordin interfaceAdmin
-
snapshotRecord
- Specified by:
snapshotRecordin interfaceAdmin
-
getOptions
- Specified by:
getOptionsin interfaceAdmin
-
shutdownServer
public void shutdownServer()- Specified by:
shutdownServerin interfaceAdmin
-
findUnmatchedStubs
- Specified by:
findUnmatchedStubsin interfaceAdmin
-
findAllStubsByMetadata
- Specified by:
findAllStubsByMetadatain interfaceAdmin
-
removeStubsByMetadata
- Specified by:
removeStubsByMetadatain interfaceAdmin
-
importStubs
- Specified by:
importStubsin interfaceAdmin
-
getGlobalSettings
- Specified by:
getGlobalSettingsin interfaceAdmin
-
checkForUnmatchedRequests
public void checkForUnmatchedRequests() -
getLoadedExtensionNames
-