java.lang.Object
java.lang.Record
org.mockserver.client.RequestExplanation
- Record Components:
correlationId- the correlation ID of the explained request's log entriestimestamp- when the explanation was computed (ISO-8601)note- the server's reminder that the result is recomputedrequest- the recorded request that was explainedatArrival- how the request was handled when it arrivedsameOutcomeAsAtArrival- whether it would be handled the same way now, ornullwhen that cannot be toldexpectationsChangedSince- whether the expectations changed at or after the moment the request arrivedexpectationsLastChanged- when the expectations last changed (ISO-8601), ornullif they never havematchedExpectation- the expectation that would serve the request now, ornullif none wouldclosestExpectationId- when none would, the expectation with the fewest differing fields, ornullskippedExpectations- the expectations evaluated ahead of the matched one, each with a reasonshadowedExpectations- lower-priority expectations that also match but are never reachedtotalExpectations- how many expectations are storedevaluatedExpectations- how many were evaluatedtruncated- whether the evaluation budget ran out before every expectation was evaluatedmaxExpectationsEvaluated- the evaluation budget whentruncated, otherwisenull
public record RequestExplanation(String correlationId, String timestamp, String note, RequestExplanation.ExplainedRequest request, RequestExplanation.Arrival atArrival, Boolean sameOutcomeAsAtArrival, boolean expectationsChangedSince, String expectationsLastChanged, RequestExplanation.ExplainedExpectation matchedExpectation, String closestExpectationId, List<RequestExplanation.ExplainedExpectation> skippedExpectations, List<RequestExplanation.ExplainedExpectation> shadowedExpectations, int totalExpectations, int evaluatedExpectations, boolean truncated, Integer maxExpectationsEvaluated)
extends Record
Which expectation would serve a recorded request now, why each expectation evaluated ahead of it was passed over,
and how the request was handled when it arrived; returned by
MockServerClient.explain(String). The result
is recomputed when asked for, against the current expectations, scenario states and remaining Times.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordOne expectation as it was evaluated.static final recordstatic final recordThe request was forwarded and the forward failed, so MockServer answered with a502.static enumHow the request was handled when it arrived.static enumWhy an expectation was passed over, in the order the gates are applied when a request is served;UNKNOWNis a reason this client does not know, sent by a newer server. -
Constructor Summary
ConstructorsConstructorDescriptionRequestExplanation(String correlationId, String timestamp, String note, RequestExplanation.ExplainedRequest request, RequestExplanation.Arrival atArrival, Boolean sameOutcomeAsAtArrival, boolean expectationsChangedSince, String expectationsLastChanged, RequestExplanation.ExplainedExpectation matchedExpectation, String closestExpectationId, List<RequestExplanation.ExplainedExpectation> skippedExpectations, List<RequestExplanation.ExplainedExpectation> shadowedExpectations, int totalExpectations, int evaluatedExpectations, boolean truncated, Integer maxExpectationsEvaluated) Creates an instance of aRequestExplanationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theatArrivalrecord component.Returns the value of theclosestExpectationIdrecord component.Returns the value of thecorrelationIdrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theevaluatedExpectationsrecord component.booleanReturns the value of theexpectationsChangedSincerecord component.Returns the value of theexpectationsLastChangedrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thematchedExpectationrecord component.Returns the value of themaxExpectationsEvaluatedrecord component.note()Returns the value of thenoterecord component.request()Returns the value of therequestrecord component.Returns the value of thesameOutcomeAsAtArrivalrecord component.Returns the value of theshadowedExpectationsrecord component.Returns the value of theskippedExpectationsrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalExpectationsrecord component.booleanReturns the value of thetruncatedrecord component.
-
Constructor Details
-
RequestExplanation
public RequestExplanation(String correlationId, String timestamp, String note, RequestExplanation.ExplainedRequest request, RequestExplanation.Arrival atArrival, Boolean sameOutcomeAsAtArrival, boolean expectationsChangedSince, String expectationsLastChanged, RequestExplanation.ExplainedExpectation matchedExpectation, String closestExpectationId, List<RequestExplanation.ExplainedExpectation> skippedExpectations, List<RequestExplanation.ExplainedExpectation> shadowedExpectations, int totalExpectations, int evaluatedExpectations, boolean truncated, Integer maxExpectationsEvaluated) Creates an instance of aRequestExplanationrecord class.- Parameters:
correlationId- the value for thecorrelationIdrecord componenttimestamp- the value for thetimestamprecord componentnote- the value for thenoterecord componentrequest- the value for therequestrecord componentatArrival- the value for theatArrivalrecord componentsameOutcomeAsAtArrival- the value for thesameOutcomeAsAtArrivalrecord componentexpectationsChangedSince- the value for theexpectationsChangedSincerecord componentexpectationsLastChanged- the value for theexpectationsLastChangedrecord componentmatchedExpectation- the value for thematchedExpectationrecord componentclosestExpectationId- the value for theclosestExpectationIdrecord componentskippedExpectations- the value for theskippedExpectationsrecord componentshadowedExpectations- the value for theshadowedExpectationsrecord componenttotalExpectations- the value for thetotalExpectationsrecord componentevaluatedExpectations- the value for theevaluatedExpectationsrecord componenttruncated- the value for thetruncatedrecord componentmaxExpectationsEvaluated- the value for themaxExpectationsEvaluatedrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
correlationId
Returns the value of thecorrelationIdrecord component.- Returns:
- the value of the
correlationIdrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
note
Returns the value of thenoterecord component.- Returns:
- the value of the
noterecord component
-
request
Returns the value of therequestrecord component.- Returns:
- the value of the
requestrecord component
-
atArrival
Returns the value of theatArrivalrecord component.- Returns:
- the value of the
atArrivalrecord component
-
sameOutcomeAsAtArrival
Returns the value of thesameOutcomeAsAtArrivalrecord component.- Returns:
- the value of the
sameOutcomeAsAtArrivalrecord component
-
expectationsChangedSince
public boolean expectationsChangedSince()Returns the value of theexpectationsChangedSincerecord component.- Returns:
- the value of the
expectationsChangedSincerecord component
-
expectationsLastChanged
Returns the value of theexpectationsLastChangedrecord component.- Returns:
- the value of the
expectationsLastChangedrecord component
-
matchedExpectation
Returns the value of thematchedExpectationrecord component.- Returns:
- the value of the
matchedExpectationrecord component
-
closestExpectationId
Returns the value of theclosestExpectationIdrecord component.- Returns:
- the value of the
closestExpectationIdrecord component
-
skippedExpectations
Returns the value of theskippedExpectationsrecord component.- Returns:
- the value of the
skippedExpectationsrecord component
-
shadowedExpectations
Returns the value of theshadowedExpectationsrecord component.- Returns:
- the value of the
shadowedExpectationsrecord component
-
totalExpectations
public int totalExpectations()Returns the value of thetotalExpectationsrecord component.- Returns:
- the value of the
totalExpectationsrecord component
-
evaluatedExpectations
public int evaluatedExpectations()Returns the value of theevaluatedExpectationsrecord component.- Returns:
- the value of the
evaluatedExpectationsrecord component
-
truncated
public boolean truncated()Returns the value of thetruncatedrecord component.- Returns:
- the value of the
truncatedrecord component
-
maxExpectationsEvaluated
Returns the value of themaxExpectationsEvaluatedrecord component.- Returns:
- the value of the
maxExpectationsEvaluatedrecord component
-