Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public final class JsonPathResultMatchers

  1. Object
  2. JsonPathResultMatchers
Expectations of one JSONPath into the JSON body, from MockMvcResultMatchers.jsonPath.

Methods

public ResultMatcher value(Object expected)The value there equals expected.
public ResultMatcher exists()A non-null value is there.
public ResultMatcher doesNotExist()No non-null value is there: the path is absent or holds JSON null.
public ResultMatcher isEmpty()An empty value is there: an empty string, list or map, or JSON null.
public ResultMatcher isNotEmpty()
public ResultMatcher isArray()
public ResultMatcher isMap()
public ResultMatcher isString()
public ResultMatcher isNumber()
public ResultMatcher isBoolean()

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()