Interface Admin
- All Known Implementing Classes:
DslWrapper,HttpAdminClient,WireMockApp,WireMockServer
public interface Admin
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessageStubMapping(MessageStubMapping messageStubMapping) Adds a message stub mapping that will be matched against incoming messages on channels.voidaddStubMapping(StubMapping stubMapping) intcountMessageEventsMatching(MessagePattern pattern) Counts message events matching the given pattern.countRequestsMatching(RequestPattern requestPattern) voideditStubMapping(StubMapping stubMapping) Finds all message stub mappings matching the given metadata pattern.findAllStubsByMetadata(StringValuePattern pattern) findMessageEventsMatching(MessagePattern pattern) Gets message events matching the given pattern.findRequestsMatching(RequestPattern requestPattern) findTopNearMissesFor(RequestPattern requestPattern) findTopNearMissesFor(LoggedRequest loggedRequest) Gets a specific message serve event by ID.Gets all message serve events from the message journal.getServedStub(UUID id) getServeEvents(ServeEventQuery query) getStubMapping(UUID id) voidimportStubs(StubImport stubImport) Lists all active message channels.Lists all message stub mappings.voidremoveMessageServeEvent(UUID eventId) Removes a specific message serve event from the journal.Removes all message serve events for stubs matching the given metadata pattern.Removes all message serve events matching the given pattern.voidRemoves a message stub mapping by its ID.voidRemoves all message stub mappings matching the given metadata pattern.voidremoveServeEvent(UUID eventId) removeServeEventsMatching(RequestPattern requestPattern) voidremoveStubMapping(StubMapping stubbMapping) voidvoidremoveStubMappings(List<StubMapping> stubMappings) voidremoveStubsByMetadata(StringValuePattern pattern) voidresetAll()voidvoidResets the message journal, removing all events.voidRemoves all message stub mappings.voidvoidresetScenario(String name) voidvoidvoidsendChannelMessage(ChannelType type, RequestPattern requestPattern, MessageDefinition message) Sends a message to all channels of the specified type matching the given request pattern.default SendChannelMessageResultsendChannelMessage(ChannelType type, RequestPattern requestPattern, String message) Sends a message to all channels of the specified type matching the given request pattern.voidsetScenarioState(String name, String state) voidsnapshotRecord(RecordSpec spec) voidstartRecording(RecordSpec spec) voidstartRecording(RecordSpecBuilder recordSpec) voidstartRecording(String targetBaseUrl) voidupdateGlobalSettings(GlobalSettings settings) waitForMessageEvent(MessagePattern pattern, Duration maxWait) Waits for a message event matching the given pattern to appear in the journal.waitForMessageEvents(MessagePattern pattern, int count, Duration maxWait) Waits for a specific number of message events matching the given pattern.
-
Method Details
-
addStubMapping
-
editStubMapping
-
removeStubMapping
-
removeStubMapping
-
listAllStubMappings
ListStubMappingsResult listAllStubMappings() -
getStubMapping
-
saveMappings
void saveMappings() -
resetRequests
void resetRequests() -
resetScenarios
void resetScenarios() -
resetMappings
void resetMappings() -
resetAll
void resetAll() -
resetToDefaultMappings
void resetToDefaultMappings() -
getServeEvents
GetServeEventsResult getServeEvents() -
getServeEvents
-
getServedStub
-
countRequestsMatching
-
findRequestsMatching
-
findUnmatchedRequests
FindRequestsResult findUnmatchedRequests() -
removeServeEvent
-
removeServeEventsMatching
-
removeServeEventsForStubsMatchingMetadata
-
findTopNearMissesFor
-
findTopNearMissesFor
-
findNearMissesForUnmatchedRequests
FindNearMissesResult findNearMissesForUnmatchedRequests() -
getAllScenarios
GetScenariosResult getAllScenarios() -
resetScenario
-
setScenarioState
-
updateGlobalSettings
-
snapshotRecord
SnapshotRecordResult snapshotRecord() -
snapshotRecord
-
snapshotRecord
-
startRecording
-
startRecording
-
startRecording
-
stopRecording
SnapshotRecordResult stopRecording() -
getRecordingStatus
RecordingStatusResult getRecordingStatus() -
getOptions
Options getOptions() -
shutdownServer
void shutdownServer() -
findUnmatchedStubs
ListStubMappingsResult findUnmatchedStubs() -
findAllStubsByMetadata
-
removeStubsByMetadata
-
importStubs
-
removeStubMappings
-
getGlobalSettings
GetGlobalSettingsResult getGlobalSettings() -
sendChannelMessage
SendChannelMessageResult sendChannelMessage(ChannelType type, RequestPattern requestPattern, MessageDefinition message) Sends a message to all channels of the specified type matching the given request pattern.- Parameters:
type- the channel type to targetrequestPattern- the pattern to match against the original upgrade requestmessage- the message to send- Returns:
- result containing the matched channels that were messaged
-
sendChannelMessage
default SendChannelMessageResult sendChannelMessage(ChannelType type, RequestPattern requestPattern, String message) Sends a message to all channels of the specified type matching the given request pattern. Convenience method that wraps the string message in a MessageDefinition.- Parameters:
type- the channel type to targetrequestPattern- the pattern to match against the original upgrade requestmessage- the message to send- Returns:
- result containing the matched channels that were messaged
-
listAllMessageChannels
ListMessageChannelsResult listAllMessageChannels()Lists all active message channels.- Returns:
- result containing all message channels
-
addMessageStubMapping
Adds a message stub mapping that will be matched against incoming messages on channels.- Parameters:
messageStubMapping- the message stub mapping to add
-
removeMessageStubMapping
Removes a message stub mapping by its ID.- Parameters:
id- the ID of the message stub mapping to remove
-
resetMessageStubMappings
void resetMessageStubMappings()Removes all message stub mappings. -
findAllMessageStubsByMetadata
Finds all message stub mappings matching the given metadata pattern.- Parameters:
pattern- the pattern to match stub metadata against- Returns:
- result containing matching message stub mappings
-
removeMessageStubsByMetadata
Removes all message stub mappings matching the given metadata pattern.- Parameters:
pattern- the pattern to match stub metadata against
-
listAllMessageStubMappings
ListMessageStubMappingsResult listAllMessageStubMappings()Lists all message stub mappings.- Returns:
- result containing all message stub mappings
-
getMessageServeEvents
GetMessageServeEventsResult getMessageServeEvents()Gets all message serve events from the message journal.- Returns:
- result containing all message serve events
-
getMessageServeEvent
Gets a specific message serve event by ID.- Parameters:
id- the event ID- Returns:
- the event if found
-
countMessageEventsMatching
Counts message events matching the given pattern.- Parameters:
pattern- the pattern to match events against- Returns:
- the count of matching events
-
findMessageEventsMatching
Gets message events matching the given pattern.- Parameters:
pattern- the pattern to match events against- Returns:
- list of matching events
-
removeMessageServeEvent
Removes a specific message serve event from the journal.- Parameters:
eventId- the ID of the event to remove
-
removeMessageServeEventsMatching
Removes all message serve events matching the given pattern.- Parameters:
pattern- the pattern to match events against- Returns:
- result containing the removed events
-
removeMessageServeEventsForStubsMatchingMetadata
FindMessageServeEventsResult removeMessageServeEventsForStubsMatchingMetadata(StringValuePattern pattern) Removes all message serve events for stubs matching the given metadata pattern.- Parameters:
pattern- the pattern to match stub metadata against- Returns:
- result containing the removed events
-
resetMessageJournal
void resetMessageJournal()Resets the message journal, removing all events. -
waitForMessageEvent
Waits for a message event matching the given pattern to appear in the journal.- Parameters:
pattern- the pattern to match events againstmaxWait- the maximum duration to wait- Returns:
- the matching event if found within the timeout
-
waitForMessageEvents
Waits for a specific number of message events matching the given pattern.- Parameters:
pattern- the pattern to match events againstcount- the number of events to wait formaxWait- the maximum duration to wait- Returns:
- list of matching events
-