Class JsonContentAssert

    • Constructor Detail

      • JsonContentAssert

        public JsonContentAssert​(Class<?> resourceLoadClass,
                                 CharSequence json)
        Create a new JsonContentAssert instance that will load resources as UTF-8.
        Parameters:
        resourceLoadClass - the source class used to load resources
        json - the actual JSON content
      • JsonContentAssert

        public JsonContentAssert​(Class<?> resourceLoadClass,
                                 Charset charset,
                                 CharSequence json)
        Create a new JsonContentAssert instance that will load resources in the given charset.
        Parameters:
        resourceLoadClass - the source class used to load resources
        charset - the charset of the JSON resources
        json - the actual JSON content
        Since:
        1.4.1
    • Method Detail

      • isEqualToJson

        public JsonContentAssert isEqualToJson​(CharSequence expected)
        Verifies that the actual value is leniently equal to the specified JSON. The expected value can contain the JSON itself or, if it ends with .json, the name of a resource to be loaded using resourceLoadClass.
        Parameters:
        expected - the expected JSON or the name of a resource containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(String path,
                                               Class<?> resourceLoadClass)
        Verifies that the actual value is leniently equal to the specified JSON resource.
        Parameters:
        path - the name of a resource containing the expected JSON
        resourceLoadClass - the source class used to load the resource
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(byte[] expected)
        Verifies that the actual value is leniently equal to the specified JSON bytes.
        Parameters:
        expected - the expected JSON bytes
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(File expected)
        Verifies that the actual value is leniently equal to the specified JSON file.
        Parameters:
        expected - a file containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(InputStream expected)
        Verifies that the actual value is leniently equal to the specified JSON input stream.
        Parameters:
        expected - an input stream containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(org.springframework.core.io.Resource expected)
        Verifies that the actual value is leniently equal to the specified JSON resource.
        Parameters:
        expected - a resource containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isStrictlyEqualToJson

        public JsonContentAssert isStrictlyEqualToJson​(CharSequence expected)
        Verifies that the actual value is strictly equal to the specified JSON. The expected value can contain the JSON itself or, if it ends with .json, the name of a resource to be loaded using resourceLoadClass.
        Parameters:
        expected - the expected JSON or the name of a resource containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isStrictlyEqualToJson

        public JsonContentAssert isStrictlyEqualToJson​(String path,
                                                       Class<?> resourceLoadClass)
        Verifies that the actual value is strictly equal to the specified JSON resource.
        Parameters:
        path - the name of a resource containing the expected JSON
        resourceLoadClass - the source class used to load the resource
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isStrictlyEqualToJson

        public JsonContentAssert isStrictlyEqualToJson​(byte[] expected)
        Verifies that the actual value is strictly equal to the specified JSON bytes.
        Parameters:
        expected - the expected JSON bytes
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isStrictlyEqualToJson

        public JsonContentAssert isStrictlyEqualToJson​(File expected)
        Verifies that the actual value is strictly equal to the specified JSON file.
        Parameters:
        expected - a file containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isStrictlyEqualToJson

        public JsonContentAssert isStrictlyEqualToJson​(InputStream expected)
        Verifies that the actual value is strictly equal to the specified JSON input stream.
        Parameters:
        expected - an input stream containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isStrictlyEqualToJson

        public JsonContentAssert isStrictlyEqualToJson​(org.springframework.core.io.Resource expected)
        Verifies that the actual value is strictly equal to the specified JSON resource.
        Parameters:
        expected - a resource containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(CharSequence expected,
                                               org.skyscreamer.jsonassert.JSONCompareMode compareMode)
        Verifies that the actual value is equal to the specified JSON. The expected value can contain the JSON itself or, if it ends with .json, the name of a resource to be loaded using resourceLoadClass.
        Parameters:
        expected - the expected JSON or the name of a resource containing the expected JSON
        compareMode - the compare mode used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(String path,
                                               Class<?> resourceLoadClass,
                                               org.skyscreamer.jsonassert.JSONCompareMode compareMode)
        Verifies that the actual value is equal to the specified JSON resource.
        Parameters:
        path - the name of a resource containing the expected JSON
        resourceLoadClass - the source class used to load the resource
        compareMode - the compare mode used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(byte[] expected,
                                               org.skyscreamer.jsonassert.JSONCompareMode compareMode)
        Verifies that the actual value is equal to the specified JSON bytes.
        Parameters:
        expected - the expected JSON bytes
        compareMode - the compare mode used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(File expected,
                                               org.skyscreamer.jsonassert.JSONCompareMode compareMode)
        Verifies that the actual value is equal to the specified JSON file.
        Parameters:
        expected - a file containing the expected JSON
        compareMode - the compare mode used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(InputStream expected,
                                               org.skyscreamer.jsonassert.JSONCompareMode compareMode)
        Verifies that the actual value is equal to the specified JSON input stream.
        Parameters:
        expected - an input stream containing the expected JSON
        compareMode - the compare mode used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(org.springframework.core.io.Resource expected,
                                               org.skyscreamer.jsonassert.JSONCompareMode compareMode)
        Verifies that the actual value is equal to the specified JSON resource.
        Parameters:
        expected - a resource containing the expected JSON
        compareMode - the compare mode used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(CharSequence expected,
                                               org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
        Verifies that the actual value is equal to the specified JSON. The expected value can contain the JSON itself or, if it ends with .json, the name of a resource to be loaded using resourceLoadClass.
        Parameters:
        expected - the expected JSON or the name of a resource containing the expected JSON
        comparator - the comparator used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(String path,
                                               Class<?> resourceLoadClass,
                                               org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
        Verifies that the actual value is equal to the specified JSON resource.
        Parameters:
        path - the name of a resource containing the expected JSON
        resourceLoadClass - the source class used to load the resource
        comparator - the comparator used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(byte[] expected,
                                               org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
        Verifies that the actual value is equal to the specified JSON bytes.
        Parameters:
        expected - the expected JSON bytes
        comparator - the comparator used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(File expected,
                                               org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
        Verifies that the actual value is equal to the specified JSON file.
        Parameters:
        expected - a file containing the expected JSON
        comparator - the comparator used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(InputStream expected,
                                               org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
        Verifies that the actual value is equal to the specified JSON input stream.
        Parameters:
        expected - an input stream containing the expected JSON
        comparator - the comparator used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isEqualToJson

        public JsonContentAssert isEqualToJson​(org.springframework.core.io.Resource expected,
                                               org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
        Verifies that the actual value is equal to the specified JSON resource.
        Parameters:
        expected - a resource containing the expected JSON
        comparator - the comparator used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is not equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(CharSequence expected)
        Verifies that the actual value is not leniently equal to the specified JSON. The expected value can contain the JSON itself or, if it ends with .json, the name of a resource to be loaded using resourceLoadClass.
        Parameters:
        expected - the expected JSON or the name of a resource containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(String path,
                                                  Class<?> resourceLoadClass)
        Verifies that the actual value is not leniently equal to the specified JSON resource.
        Parameters:
        path - the name of a resource containing the expected JSON
        resourceLoadClass - the source class used to load the resource
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(byte[] expected)
        Verifies that the actual value is not leniently equal to the specified JSON bytes.
        Parameters:
        expected - the expected JSON bytes
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(File expected)
        Verifies that the actual value is not leniently equal to the specified JSON file.
        Parameters:
        expected - a file containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(InputStream expected)
        Verifies that the actual value is not leniently equal to the specified JSON input stream.
        Parameters:
        expected - an input stream containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(org.springframework.core.io.Resource expected)
        Verifies that the actual value is not leniently equal to the specified JSON resource.
        Parameters:
        expected - a resource containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotStrictlyEqualToJson

        public JsonContentAssert isNotStrictlyEqualToJson​(CharSequence expected)
        Verifies that the actual value is not strictly equal to the specified JSON. The expected value can contain the JSON itself or, if it ends with .json, the name of a resource to be loaded using resourceLoadClass.
        Parameters:
        expected - the expected JSON or the name of a resource containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotStrictlyEqualToJson

        public JsonContentAssert isNotStrictlyEqualToJson​(String path,
                                                          Class<?> resourceLoadClass)
        Verifies that the actual value is not strictly equal to the specified JSON resource.
        Parameters:
        path - the name of a resource containing the expected JSON
        resourceLoadClass - the source class used to load the resource
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotStrictlyEqualToJson

        public JsonContentAssert isNotStrictlyEqualToJson​(byte[] expected)
        Verifies that the actual value is not strictly equal to the specified JSON bytes.
        Parameters:
        expected - the expected JSON bytes
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotStrictlyEqualToJson

        public JsonContentAssert isNotStrictlyEqualToJson​(File expected)
        Verifies that the actual value is not strictly equal to the specified JSON file.
        Parameters:
        expected - a file containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotStrictlyEqualToJson

        public JsonContentAssert isNotStrictlyEqualToJson​(InputStream expected)
        Verifies that the actual value is not strictly equal to the specified JSON input stream.
        Parameters:
        expected - an input stream containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotStrictlyEqualToJson

        public JsonContentAssert isNotStrictlyEqualToJson​(org.springframework.core.io.Resource expected)
        Verifies that the actual value is not strictly equal to the specified JSON resource.
        Parameters:
        expected - a resource containing the expected JSON
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(CharSequence expected,
                                                  org.skyscreamer.jsonassert.JSONCompareMode compareMode)
        Verifies that the actual value is not equal to the specified JSON. The expected value can contain the JSON itself or, if it ends with .json, the name of a resource to be loaded using resourceLoadClass.
        Parameters:
        expected - the expected JSON or the name of a resource containing the expected JSON
        compareMode - the compare mode used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(String path,
                                                  Class<?> resourceLoadClass,
                                                  org.skyscreamer.jsonassert.JSONCompareMode compareMode)
        Verifies that the actual value is not equal to the specified JSON resource.
        Parameters:
        path - the name of a resource containing the expected JSON
        resourceLoadClass - the source class used to load the resource
        compareMode - the compare mode used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(byte[] expected,
                                                  org.skyscreamer.jsonassert.JSONCompareMode compareMode)
        Verifies that the actual value is not equal to the specified JSON bytes.
        Parameters:
        expected - the expected JSON bytes
        compareMode - the compare mode used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(File expected,
                                                  org.skyscreamer.jsonassert.JSONCompareMode compareMode)
        Verifies that the actual value is not equal to the specified JSON file.
        Parameters:
        expected - a file containing the expected JSON
        compareMode - the compare mode used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(InputStream expected,
                                                  org.skyscreamer.jsonassert.JSONCompareMode compareMode)
        Verifies that the actual value is not equal to the specified JSON input stream.
        Parameters:
        expected - an input stream containing the expected JSON
        compareMode - the compare mode used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(org.springframework.core.io.Resource expected,
                                                  org.skyscreamer.jsonassert.JSONCompareMode compareMode)
        Verifies that the actual value is not equal to the specified JSON resource.
        Parameters:
        expected - a resource containing the expected JSON
        compareMode - the compare mode used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(CharSequence expected,
                                                  org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
        Verifies that the actual value is not equal to the specified JSON. The expected value can contain the JSON itself or, if it ends with .json, the name of a resource to be loaded using resourceLoadClass.
        Parameters:
        expected - the expected JSON or the name of a resource containing the expected JSON
        comparator - the comparator used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(String path,
                                                  Class<?> resourceLoadClass,
                                                  org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
        Verifies that the actual value is not equal to the specified JSON resource.
        Parameters:
        path - the name of a resource containing the expected JSON
        resourceLoadClass - the source class used to load the resource
        comparator - the comparator used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(byte[] expected,
                                                  org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
        Verifies that the actual value is not equal to the specified JSON bytes.
        Parameters:
        expected - the expected JSON bytes
        comparator - the comparator used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(File expected,
                                                  org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
        Verifies that the actual value is not equal to the specified JSON file.
        Parameters:
        expected - a file containing the expected JSON
        comparator - the comparator used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(InputStream expected,
                                                  org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
        Verifies that the actual value is not equal to the specified JSON input stream.
        Parameters:
        expected - an input stream containing the expected JSON
        comparator - the comparator used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • isNotEqualToJson

        public JsonContentAssert isNotEqualToJson​(org.springframework.core.io.Resource expected,
                                                  org.skyscreamer.jsonassert.comparator.JSONComparator comparator)
        Verifies that the actual value is not equal to the specified JSON resource.
        Parameters:
        expected - a resource containing the expected JSON
        comparator - the comparator used when checking
        Returns:
        this assertion object
        Throws:
        AssertionError - if the actual JSON value is equal to the given one
      • hasJsonPathValue

        public JsonContentAssert hasJsonPathValue​(CharSequence expression,
                                                  Object... args)
        Verify that the actual value at the given JSON path produces a non-null result. If the JSON path expression is not definite, this method verifies that the value at the given path is not empty.
        Parameters:
        expression - the JsonPath expression
        args - arguments to parameterize the JsonPath expression with, using formatting specifiers defined in String.format(String, Object...)
        Returns:
        this assertion object
        Throws:
        AssertionError - if the value at the given path is missing
      • doesNotHaveJsonPathValue

        public JsonContentAssert doesNotHaveJsonPathValue​(CharSequence expression,
                                                          Object... args)
        Verify that the actual value at the given JSON path produces no result. If the JSON path expression is not definite, this method verifies that the value at the given path is empty.
        Parameters:
        expression - the JsonPath expression
        args - arguments to parameterize the JsonPath expression with, using formatting specifiers defined in String.format(String, Object...)
        Returns:
        this assertion object
        Throws:
        AssertionError - if the value at the given path is not missing
      • extractingJsonPathValue

        public org.assertj.core.api.AbstractObjectAssert<?,​ObjectextractingJsonPathValue​(CharSequence expression,
                                                                                                 Object... args)
        Extract the value at the given JSON path for further object assertions.
        Parameters:
        expression - the JsonPath expression
        args - arguments to parameterize the JsonPath expression with, using formatting specifiers defined in String.format(String, Object...)
        Returns:
        a new assertion object whose object under test is the extracted item
        Throws:
        AssertionError - if the path is not valid
      • extractingJsonPathStringValue

        public org.assertj.core.api.AbstractCharSequenceAssert<?,​StringextractingJsonPathStringValue​(CharSequence expression,
                                                                                                             Object... args)
        Extract the string value at the given JSON path for further object assertions.
        Parameters:
        expression - the JsonPath expression
        args - arguments to parameterize the JsonPath expression with, using formatting specifiers defined in String.format(String, Object...)
        Returns:
        a new assertion object whose object under test is the extracted item
        Throws:
        AssertionError - if the path is not valid or does not result in a string
      • extractingJsonPathNumberValue

        public org.assertj.core.api.AbstractObjectAssert<?,​NumberextractingJsonPathNumberValue​(CharSequence expression,
                                                                                                       Object... args)
        Extract the number value at the given JSON path for further object assertions.
        Parameters:
        expression - the JsonPath expression
        args - arguments to parameterize the JsonPath expression with, using formatting specifiers defined in String.format(String, Object...)
        Returns:
        a new assertion object whose object under test is the extracted item
        Throws:
        AssertionError - if the path is not valid or does not result in a number
      • extractingJsonPathBooleanValue

        public org.assertj.core.api.AbstractBooleanAssert<?> extractingJsonPathBooleanValue​(CharSequence expression,
                                                                                            Object... args)
        Extract the boolean value at the given JSON path for further object assertions.
        Parameters:
        expression - the JsonPath expression
        args - arguments to parameterize the JsonPath expression with, using formatting specifiers defined in String.format(String, Object...)
        Returns:
        a new assertion object whose object under test is the extracted item
        Throws:
        AssertionError - if the path is not valid or does not result in a boolean
      • extractingJsonPathArrayValue

        public <E> org.assertj.core.api.ListAssert<E> extractingJsonPathArrayValue​(CharSequence expression,
                                                                                   Object... args)
        Extract the array value at the given JSON path for further object assertions.
        Type Parameters:
        E - element type
        Parameters:
        expression - the JsonPath expression
        args - arguments to parameterize the JsonPath expression with, using formatting specifiers defined in String.format(String, Object...)
        Returns:
        a new assertion object whose object under test is the extracted item
        Throws:
        AssertionError - if the path is not valid or does not result in an array
      • extractingJsonPathMapValue

        public <K,​V> org.assertj.core.api.MapAssert<K,​V> extractingJsonPathMapValue​(CharSequence expression,
                                                                                                Object... args)
        Extract the map value at the given JSON path for further object assertions.
        Type Parameters:
        K - key type
        V - value type
        Parameters:
        expression - the JsonPath expression
        args - arguments to parameterize the JsonPath expression with, using formatting specifiers defined in String.format(String, Object...)
        Returns:
        a new assertion object whose object under test is the extracted item
        Throws:
        AssertionError - if the path is not valid or does not result in a map