Class WireMockRule

java.lang.Object
org.kohsuke.github.junit.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

    Constructors
    Constructor
    Description
    Instantiates 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 Type
    Method
    Description
    void
    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.
    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.
    Base url.
    protected void
    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
    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
    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.
    void
    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
    Reset all.
    void
    Reset mappings.
    void
    Reset requests.
    void
    Reset a scenario
    void
    Reset scenarios.
    void
    Reset to default mappings.
    void
    Save mappings.
    void
    setGlobalFixedDelay(int milliseconds)
    Sets the global fixed delay.
    void
    Set scenario state
    void
    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.
    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.
    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(String path)
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 options
      failOnUnmatchedRequests - the fail on unmatched requests
    • WireMockRule

      public WireMockRule(int port)
      Instantiates a new wire mock rule.
      Parameters:
      port - the port
    • WireMockRule

      public WireMockRule(int port, Integer httpsPort)
      Instantiates a new wire mock rule.
      Parameters:
      port - the port
      httpsPort - the https port
    • WireMockRule

      public WireMockRule()
      Instantiates a new wire mock rule.
  • Method Details

    • getMethodName

      public String 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 interface org.junit.rules.TestRule
      Parameters:
      base - the base
      description - 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 interface org.junit.rules.MethodRule
      Parameters:
      base - the base
      method - the method
      target - 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 source
      filesFileSource - the files file source
    • stop

      public void stop()
      Stop.
    • start

      public void start()
      Start.
    • shutdown

      public void shutdown()
      Shutdown.
      Specified by:
      shutdown in interface com.github.tomakehurst.wiremock.core.Container
    • port

      public int port()
      Port.
      Specified by:
      port in interface com.github.tomakehurst.wiremock.core.Container
      Returns:
      the int
    • httpsPort

      public int httpsPort()
      Https port.
      Returns:
      the int
    • url

      public String url(String path)
      Url.
      Parameters:
      path - the path
      Returns:
      the string
    • baseUrl

      public 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 interface com.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 interface com.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 interface com.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 interface com.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 interface com.github.tomakehurst.wiremock.junit.Stubbing
      Parameters:
      stubMapping - the stub mapping
    • getStubMappings

      public List<com.github.tomakehurst.wiremock.stubbing.StubMapping> getStubMappings()
      Gets the stub mappings.
      Specified by:
      getStubMappings in interface com.github.tomakehurst.wiremock.junit.Stubbing
      Returns:
      the stub mappings
    • getSingleStubMapping

      public com.github.tomakehurst.wiremock.stubbing.StubMapping getSingleStubMapping(UUID id)
      Gets the single stub mapping.
      Specified by:
      getSingleStubMapping in interface com.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 interface com.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 interface com.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 interface com.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 interface com.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 interface com.github.tomakehurst.wiremock.junit.Stubbing
      Parameters:
      count - the count
      requestPatternBuilder - 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 interface com.github.tomakehurst.wiremock.junit.Stubbing
      Parameters:
      countMatchingStrategy - the count matching strategy
      requestPatternBuilder - 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 interface com.github.tomakehurst.wiremock.junit.Stubbing
      Parameters:
      requestPatternBuilder - the request pattern builder
      Returns:
      the list
    • getAllServeEvents

      public List<com.github.tomakehurst.wiremock.stubbing.ServeEvent> getAllServeEvents()
      Gets the all serve events.
      Specified by:
      getAllServeEvents in interface com.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 interface com.github.tomakehurst.wiremock.junit.Stubbing
      Parameters:
      milliseconds - the new global fixed delay
    • findAllUnmatchedRequests

      public List<com.github.tomakehurst.wiremock.verification.LoggedRequest> findAllUnmatchedRequests()
      Find all unmatched requests.
      Specified by:
      findAllUnmatchedRequests in interface com.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 interface com.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 interface com.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 interface com.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 interface com.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 interface com.github.tomakehurst.wiremock.core.Admin
      Parameters:
      stubMapping - the stub mapping
    • removeStubMapping

      public void removeStubMapping(UUID id)
      Removes the stub mapping.
      Specified by:
      removeStubMapping in interface com.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 interface com.github.tomakehurst.wiremock.core.Admin
      Returns:
      the list stub mappings result
    • getStubMapping

      public com.github.tomakehurst.wiremock.admin.model.SingleStubMappingResult getStubMapping(UUID id)
      Gets the stub mapping.
      Specified by:
      getStubMapping in interface com.github.tomakehurst.wiremock.core.Admin
      Parameters:
      id - the id
      Returns:
      the stub mapping
    • saveMappings

      public void saveMappings()
      Save mappings.
      Specified by:
      saveMappings in interface com.github.tomakehurst.wiremock.core.Admin
    • resetAll

      public void resetAll()
      Reset all.
      Specified by:
      resetAll in interface com.github.tomakehurst.wiremock.core.Admin
    • resetRequests

      public void resetRequests()
      Reset requests.
      Specified by:
      resetRequests in interface com.github.tomakehurst.wiremock.core.Admin
    • resetToDefaultMappings

      public void resetToDefaultMappings()
      Reset to default mappings.
      Specified by:
      resetToDefaultMappings in interface com.github.tomakehurst.wiremock.core.Admin
    • getServeEvents

      public com.github.tomakehurst.wiremock.admin.model.GetServeEventsResult getServeEvents()
      Gets the serve events.
      Specified by:
      getServeEvents in interface com.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 interface com.github.tomakehurst.wiremock.core.Admin
      Parameters:
      serveEventQuery - the serve event query
      Returns:
      the serve events
    • getServedStub

      public com.github.tomakehurst.wiremock.admin.model.SingleServedStubResult getServedStub(UUID id)
      Gets the served stub.
      Specified by:
      getServedStub in interface com.github.tomakehurst.wiremock.core.Admin
      Parameters:
      id - the id
      Returns:
      the served stub
    • resetScenarios

      public void resetScenarios()
      Reset scenarios.
      Specified by:
      resetScenarios in interface com.github.tomakehurst.wiremock.core.Admin
    • resetMappings

      public void resetMappings()
      Reset mappings.
      Specified by:
      resetMappings in interface com.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 interface com.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 interface com.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 interface com.github.tomakehurst.wiremock.core.Admin
      Returns:
      the find requests result
    • removeServeEvent

      public void removeServeEvent(UUID uuid)
      Removes the serve event.
      Specified by:
      removeServeEvent in interface com.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 interface com.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 interface com.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 interface com.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 interface com.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 interface com.github.tomakehurst.wiremock.core.Admin
      Returns:
      the all scenarios
    • resetScenario

      public void resetScenario(String name)
      Reset a scenario
      Specified by:
      resetScenario in interface com.github.tomakehurst.wiremock.core.Admin
      Parameters:
      name - the name
    • setScenarioState

      public void setScenarioState(String name, String state)
      Set scenario state
      Specified by:
      setScenarioState in interface com.github.tomakehurst.wiremock.core.Admin
      Parameters:
      name - the name
      state - 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 interface com.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 interface com.github.tomakehurst.wiremock.core.Admin
      Parameters:
      requestPattern - the request pattern
      Returns:
      the find near misses result
    • startRecording

      public void startRecording(String targetBaseUrl)
      Start recording.
      Specified by:
      startRecording in interface com.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 interface com.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 interface com.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 interface com.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 interface com.github.tomakehurst.wiremock.core.Admin
      Returns:
      the recording status
    • snapshotRecord

      public com.github.tomakehurst.wiremock.recording.SnapshotRecordResult snapshotRecord()
      Snapshot record.
      Specified by:
      snapshotRecord in interface com.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 interface com.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 interface com.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 interface com.github.tomakehurst.wiremock.core.Admin
      Returns:
      the options
    • shutdownServer

      public void shutdownServer()
      Shutdown server.
      Specified by:
      shutdownServer in interface com.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 interface com.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 interface com.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 interface com.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 interface com.github.tomakehurst.wiremock.core.Admin
      Returns:
      the global settings