Package org.mockserver.model
Class CaptureRule
java.lang.Object
org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
org.mockserver.model.CaptureRule
Declarative capture rule (WS2.2): when an expectation matches an incoming
request, each capture rule extracts a value from the request and stores it
into scenario state under the
into name, so a later request's
response template can read it back via scenario.get(name) (WS2.1).
A rule has three parts:
source— where in the request to look (jsonPath,xpath,header,queryStringParameter,cookie,pathParameter).expression— the selector evaluated against that source (a JSONPath / XPath expression, or a header / parameter / cookie name).into— the scenario name whose state is set to the captured value.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe part of the request a capture rule reads from. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CaptureRulecapture(CaptureRule.Source source, String expression, String into) static CaptureRulegetInto()withExpression(String expression) withSource(CaptureRule.Source source) Methods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
equals, fieldsExcludedFromEqualsAndHashCode, hashCode, toString
-
Constructor Details
-
CaptureRule
public CaptureRule()
-
-
Method Details
-
captureRule
-
capture
-
getSource
-
withSource
-
getExpression
-
withExpression
-
getInto
-
withInto
-