Class RecordedExpectationsOptions

java.lang.Object
org.mockserver.client.RecordedExpectationsOptions

public class RecordedExpectationsOptions extends Object
Options that shape the expectations returned by MockServerClient.retrieveRecordedExpectations(org.mockserver.model.RequestDefinition, RecordedExpectationsOptions). Each option is off unless set, so an empty options object returns the recorded expectations unchanged.
  • Constructor Details

    • RecordedExpectationsOptions

      public RecordedExpectationsOptions()
  • Method Details

    • recordedExpectationsOptions

      public static RecordedExpectationsOptions recordedExpectationsOptions()
    • withConsolidate

      public RecordedExpectationsOptions withConsolidate(Boolean consolidate)
      Collapse recorded exchanges that share a request shape into one reusable, unlimited-times expectation.
    • withParameterize

      public RecordedExpectationsOptions withParameterize(Boolean parameterize)
      Also generalise volatile path, query, header and body values into matchers (implies consolidate).
    • withRepeatsAsScenarios

      public RecordedExpectationsOptions withRepeatsAsScenarios(Boolean repeatsAsScenarios)
      When the same request was recorded several times with different responses, return one expectation that replays those responses in the recorded order and then keeps returning the last one.
    • withCaptureHeaders

      public RecordedExpectationsOptions withCaptureHeaders(String... headerNames)
      Keep only these request headers (case-insensitive) in each recorded request matcher; no names keeps none, null leaves the option unset.
    • withExtractBodiesLargerThan

      public RecordedExpectationsOptions withExtractBodiesLargerThan(Long thresholdBytes)
      Write each response body larger than this many bytes to the server's configured recordedBodyFilesDirectory and reference it as a FILE body.
    • getConsolidate

      public Boolean getConsolidate()
    • getParameterize

      public Boolean getParameterize()
    • getRepeatsAsScenarios

      public Boolean getRepeatsAsScenarios()
    • getCaptureHeaders

      public List<String> getCaptureHeaders()
    • getExtractBodiesLargerThan

      public Long getExtractBodiesLargerThan()