Class PathBodyMatcher
- java.lang.Object
-
- org.springframework.cloud.contract.spec.internal.PathBodyMatcher
-
- All Implemented Interfaces:
BodyMatcher
public class PathBodyMatcher extends Object implements BodyMatcher
- Author:
- Marcin Grzejszczak
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()MatchingTypematchingType()IntegermaxTypeOccurrence()IntegerminTypeOccurrence()Stringpath()StringtoString()Objectvalue()
-
-
-
Method Detail
-
matchingType
public MatchingType matchingType()
- Specified by:
matchingTypein interfaceBodyMatcher- Returns:
- What kind of matching are we dealing with.
-
path
public String path()
- Specified by:
pathin interfaceBodyMatcher- Returns:
- Path to the path. Example for JSON it will be JSON Path.
-
value
public Object value()
- Specified by:
valuein interfaceBodyMatcher- Returns:
- Optional value that the given path should be checked against. If there is
no value then presence will be checked only together with type check. Example if we
expect a JSON Path path
$.ato be matched. by type, the defined response body contained an integer but the actual one contained a string then the assertion should fail.
-
minTypeOccurrence
public Integer minTypeOccurrence()
- Specified by:
minTypeOccurrencein interfaceBodyMatcher- Returns:
- Min no of occurrence when matching by type. In all other cases it will be ignored.
-
maxTypeOccurrence
public Integer maxTypeOccurrence()
- Specified by:
maxTypeOccurrencein interfaceBodyMatcher- Returns:
- Max no of occurrence when matching by type. In all other cases it will be ignored.
-
-