Class BodyMatchers
java.lang.Object
org.springframework.cloud.contract.spec.internal.BodyMatchers
- Direct Known Subclasses:
ResponseBodyMatchers
Matching strategy of dynamic parts of the body.
- Since:
- 1.0.3
- Author:
- Marcin Grzejszczak, Olga Maciaszek-Sharma, Tim Ysewyn
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyDate()byRegex(RegexProperty regex) byTime()byType(groovy.lang.Closure consumer) The output part of the contract.byType(Consumer<MatchingTypeValueHolder> consumer) The output part of the contract.booleaninthashCode()booleanvoidjsonPath(String path, MatchingTypeValue matchingType) matchers()toString()voidxPath(String xPath, MatchingTypeValue matchingTypeValue) Adds xPath matcher; even though same implementation as injsonPath(java.lang.String, org.springframework.cloud.contract.spec.internal.MatchingTypeValue), added for logical coherence in xml.
-
Field Details
-
matchers
-
-
Constructor Details
-
BodyMatchers
public BodyMatchers()
-
-
Method Details
-
jsonPath
-
xPath
Adds xPath matcher; even though same implementation as injsonPath(java.lang.String, org.springframework.cloud.contract.spec.internal.MatchingTypeValue), added for logical coherence in xml.- Parameters:
xPath- the xPath used to find the element to matchmatchingTypeValue- to match the element found by the xPath against
-
hasMatchers
public boolean hasMatchers() -
matchers
-
byDate
-
byTime
-
byTimestamp
-
byRegex
-
byRegex
-
byRegex
-
byEquality
-
equals
-
hashCode
public int hashCode() -
toString
-
byType
The output part of the contract.- Parameters:
consumer- function to manipulate the output message- Returns:
- matching type
-
byType
public MatchingTypeValue byType(@DelegatesTo(MatchingTypeValueHolder.class) groovy.lang.Closure consumer) The output part of the contract.- Parameters:
consumer- function to manipulate the output message- Returns:
- matching type
-