Class JsonPathResultMatchers

java.lang.Object
com.codename1.backend.test.JsonPathResultMatchers

public final class JsonPathResultMatchers extends Object
Expectations of one JSONPath into the JSON body, from MockMvcResultMatchers.jsonPath(String, Object...).
  • 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()