Interface Admin

All Known Implementing Classes:
DslWrapper, HttpAdminClient, WireMockApp, WireMockServer

public interface Admin
  • Method Details

    • addStubMapping

      void addStubMapping(StubMapping stubMapping)
    • editStubMapping

      void editStubMapping(StubMapping stubMapping)
    • removeStubMapping

      void removeStubMapping(StubMapping stubbMapping)
    • removeStubMapping

      void removeStubMapping(UUID id)
    • listAllStubMappings

      ListStubMappingsResult listAllStubMappings()
    • getStubMapping

      SingleStubMappingResult getStubMapping(UUID id)
    • saveMappings

      void saveMappings()
    • resetRequests

      void resetRequests()
    • resetScenarios

      void resetScenarios()
    • resetMappings

      void resetMappings()
    • resetAll

      void resetAll()
    • resetToDefaultMappings

      void resetToDefaultMappings()
    • getServeEvents

      GetServeEventsResult getServeEvents()
    • getServeEvents

      GetServeEventsResult getServeEvents(ServeEventQuery query)
    • getServedStub

      SingleServedStubResult getServedStub(UUID id)
    • countRequestsMatching

      VerificationResult countRequestsMatching(RequestPattern requestPattern)
    • findRequestsMatching

      FindRequestsResult findRequestsMatching(RequestPattern requestPattern)
    • findUnmatchedRequests

      FindRequestsResult findUnmatchedRequests()
    • removeServeEvent

      void removeServeEvent(UUID eventId)
    • removeServeEventsMatching

      FindServeEventsResult removeServeEventsMatching(RequestPattern requestPattern)
    • removeServeEventsForStubsMatchingMetadata

      FindServeEventsResult removeServeEventsForStubsMatchingMetadata(StringValuePattern pattern)
    • findTopNearMissesFor

      FindNearMissesResult findTopNearMissesFor(LoggedRequest loggedRequest)
    • findTopNearMissesFor

      FindNearMissesResult findTopNearMissesFor(RequestPattern requestPattern)
    • findNearMissesForUnmatchedRequests

      FindNearMissesResult findNearMissesForUnmatchedRequests()
    • getAllScenarios

      GetScenariosResult getAllScenarios()
    • resetScenario

      void resetScenario(String name)
    • setScenarioState

      void setScenarioState(String name, String state)
    • updateGlobalSettings

      void updateGlobalSettings(GlobalSettings settings)
    • snapshotRecord

      SnapshotRecordResult snapshotRecord()
    • snapshotRecord

      SnapshotRecordResult snapshotRecord(RecordSpec spec)
    • snapshotRecord

    • startRecording

      void startRecording(String targetBaseUrl)
    • startRecording

      void startRecording(RecordSpec spec)
    • startRecording

      void startRecording(RecordSpecBuilder recordSpec)
    • stopRecording

      SnapshotRecordResult stopRecording()
    • getRecordingStatus

      RecordingStatusResult getRecordingStatus()
    • getOptions

      Options getOptions()
    • shutdownServer

      void shutdownServer()
    • findUnmatchedStubs

      ListStubMappingsResult findUnmatchedStubs()
    • findAllStubsByMetadata

      ListStubMappingsResult findAllStubsByMetadata(StringValuePattern pattern)
    • removeStubsByMetadata

      void removeStubsByMetadata(StringValuePattern pattern)
    • importStubs

      void importStubs(StubImport stubImport)
    • removeStubMappings

      void removeStubMappings(List<StubMapping> stubMappings)
    • 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 target
      requestPattern - the pattern to match against the original upgrade request
      message - 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 target
      requestPattern - the pattern to match against the original upgrade request
      message - 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

      void addMessageStubMapping(MessageStubMapping messageStubMapping)
      Adds a message stub mapping that will be matched against incoming messages on channels.
      Parameters:
      messageStubMapping - the message stub mapping to add
    • removeMessageStubMapping

      void removeMessageStubMapping(UUID id)
      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

      ListMessageStubMappingsResult findAllMessageStubsByMetadata(StringValuePattern pattern)
      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

      void removeMessageStubsByMetadata(StringValuePattern pattern)
      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

      SingleMessageServeEventResult getMessageServeEvent(UUID id)
      Gets a specific message serve event by ID.
      Parameters:
      id - the event ID
      Returns:
      the event if found
    • countMessageEventsMatching

      int countMessageEventsMatching(MessagePattern pattern)
      Counts message events matching the given pattern.
      Parameters:
      pattern - the pattern to match events against
      Returns:
      the count of matching events
    • findMessageEventsMatching

      List<MessageServeEvent> findMessageEventsMatching(MessagePattern pattern)
      Gets message events matching the given pattern.
      Parameters:
      pattern - the pattern to match events against
      Returns:
      list of matching events
    • removeMessageServeEvent

      void removeMessageServeEvent(UUID eventId)
      Removes a specific message serve event from the journal.
      Parameters:
      eventId - the ID of the event to remove
    • removeMessageServeEventsMatching

      FindMessageServeEventsResult removeMessageServeEventsMatching(MessagePattern pattern)
      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

      Optional<MessageServeEvent> waitForMessageEvent(MessagePattern pattern, Duration maxWait)
      Waits for a message event matching the given pattern to appear in the journal.
      Parameters:
      pattern - the pattern to match events against
      maxWait - the maximum duration to wait
      Returns:
      the matching event if found within the timeout
    • waitForMessageEvents

      List<MessageServeEvent> waitForMessageEvents(MessagePattern pattern, int count, Duration maxWait)
      Waits for a specific number of message events matching the given pattern.
      Parameters:
      pattern - the pattern to match events against
      count - the number of events to wait for
      maxWait - the maximum duration to wait
      Returns:
      list of matching events