Record Class RequestExplanation.ExplainedExpectation

java.lang.Object
java.lang.Record
org.mockserver.client.RequestExplanation.ExplainedExpectation
Record Components:
expectationId - the expectation's id
expectationMethod - the method it matches, or null
expectationPath - the path it matches, or null
position - its 1-based position in the order expectations are evaluated
priority - its priority
reason - why it was passed over, or null for the matched expectation (never for a skipped one)
explanation - why it was passed over, in plain language, or null
matches - whether the request matches its request matcher, or null when an earlier gate decided
differingFieldCount - how many fields differ, or null when it was not compared field by field
differences - for each differing field, the differences found
remediation - for each differing field, a hint on how to change the expectation
Enclosing class:
RequestExplanation

public static record RequestExplanation.ExplainedExpectation(String expectationId, String expectationMethod, String expectationPath, int position, int priority, RequestExplanation.Reason reason, String explanation, Boolean matches, Integer differingFieldCount, Map<String,List<String>> differences, Map<String,String> remediation) extends Record
One expectation as it was evaluated. The matched expectation has no reason; a skipped or shadowed one has a reason and an explanation, and one compared field by field also has the differences and remediation hints.
  • Constructor Details

  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • expectationId

      public String expectationId()
      Returns the value of the expectationId record component.
      Returns:
      the value of the expectationId record component
    • expectationMethod

      public String expectationMethod()
      Returns the value of the expectationMethod record component.
      Returns:
      the value of the expectationMethod record component
    • expectationPath

      public String expectationPath()
      Returns the value of the expectationPath record component.
      Returns:
      the value of the expectationPath record component
    • position

      public int position()
      Returns the value of the position record component.
      Returns:
      the value of the position record component
    • priority

      public int priority()
      Returns the value of the priority record component.
      Returns:
      the value of the priority record component
    • reason

      public RequestExplanation.Reason reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component
    • explanation

      public String explanation()
      Returns the value of the explanation record component.
      Returns:
      the value of the explanation record component
    • matches

      public Boolean matches()
      Returns the value of the matches record component.
      Returns:
      the value of the matches record component
    • differingFieldCount

      public Integer differingFieldCount()
      Returns the value of the differingFieldCount record component.
      Returns:
      the value of the differingFieldCount record component
    • differences

      public Map<String,List<String>> differences()
      Returns the value of the differences record component.
      Returns:
      the value of the differences record component
    • remediation

      public Map<String,String> remediation()
      Returns the value of the remediation record component.
      Returns:
      the value of the remediation record component