Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class JsonPathResultMatchers
- Object
- JsonPathResultMatchers
Expectations of one JSONPath into the JSON body, from
MockMvcResultMatchers.jsonPath.Methods
Inherited methods
Method details
value
public ResultMatcher value(Object expected)The value there equals
expected. Numbers compare by value, so 5
matches the parser’s 5L; a list compares element by element.exists
public ResultMatcher exists()A non-null value is there. A JSON
null does not count, as in Spring:
{"value":null} fails exists() and passes doesNotExist.doesNotExist
public ResultMatcher doesNotExist()No non-null value is there: the path is absent or holds JSON
null.isEmpty
public ResultMatcher isEmpty()An empty value is there: an empty string, list or map, or JSON
null. An
absent path fails, as isNotEmpty does – it is not an empty value.isNotEmpty
public ResultMatcher isNotEmpty()isArray
public ResultMatcher isArray()isMap
public ResultMatcher isMap()isString
public ResultMatcher isString()isNumber
public ResultMatcher isNumber()isBoolean
public ResultMatcher isBoolean()