public class BodyMatchers extends Object
| Modifier and Type | Field and Description |
|---|---|
protected List<BodyMatcher> |
matchers |
| Constructor and Description |
|---|
BodyMatchers() |
| Modifier and Type | Method and Description |
|---|---|
MatchingTypeValue |
byDate() |
MatchingTypeValue |
byEquality() |
RegexMatchingTypeValue |
byRegex(Pattern regex) |
RegexMatchingTypeValue |
byRegex(RegexProperty regex) |
RegexMatchingTypeValue |
byRegex(String regex) |
MatchingTypeValue |
byTime() |
MatchingTypeValue |
byTimestamp() |
MatchingTypeValue |
byType(groovy.lang.Closure consumer)
The output part of the contract.
|
MatchingTypeValue |
byType(Consumer<MatchingTypeValueHolder> consumer)
The output part of the contract.
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
hasMatchers() |
void |
jsonPath(String path,
MatchingTypeValue matchingType) |
List<BodyMatcher> |
matchers() |
String |
toString() |
void |
xPath(String xPath,
MatchingTypeValue matchingTypeValue)
Adds xPath matcher; even though same implementation as in
jsonPath(java.lang.String, org.springframework.cloud.contract.spec.internal.MatchingTypeValue),
added for logical coherence in xml. |
protected final List<BodyMatcher> matchers
public void jsonPath(String path, MatchingTypeValue matchingType)
public void xPath(String xPath, MatchingTypeValue matchingTypeValue)
jsonPath(java.lang.String, org.springframework.cloud.contract.spec.internal.MatchingTypeValue),
added for logical coherence in xml.xPath - the xPath used to find the element to matchmatchingTypeValue - to match the element found by the xPath againstpublic boolean hasMatchers()
public List<BodyMatcher> matchers()
public MatchingTypeValue byDate()
public MatchingTypeValue byTime()
public MatchingTypeValue byTimestamp()
public RegexMatchingTypeValue byRegex(String regex)
public RegexMatchingTypeValue byRegex(RegexProperty regex)
public RegexMatchingTypeValue byRegex(Pattern regex)
public MatchingTypeValue byEquality()
public MatchingTypeValue byType(Consumer<MatchingTypeValueHolder> consumer)
consumer - function to manipulate the output messagepublic MatchingTypeValue byType(@DelegatesTo(value=MatchingTypeValueHolder.class) groovy.lang.Closure consumer)
consumer - function to manipulate the output messageCopyright © 2016–2020 Spring. All rights reserved.