Class JsonAssertion<M>

  • Type Parameters:
    M - type of data to match
    All Implemented Interfaces:
    Serializable, Comparable<org.apache.commons.lang3.tuple.Pair<String,​org.hamcrest.Matcher<M>>>, Map.Entry<String,​org.hamcrest.Matcher<M>>

    public class JsonAssertion<M>
    extends Assertion<String,​M>
    Represents a JSON assertion as a JSON path paired with a Hamcrest matcher.

    NOTE: not designed for serialization

    Author:
    aherscu
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class org.apache.commons.lang3.tuple.MutablePair

        EMPTY_ARRAY, left, right
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonAssertion​(String jsonPath)
      Constructs a JSON assertion without a matcher.
      JsonAssertion​(String jsonPath, org.hamcrest.Matcher<M> matcher)
      Constructs a JSON assertion with specified matcher.
    • Method Summary

      • Methods inherited from class dev.aherscu.qa.testing.utils.assertions.Assertion

        toString
      • Methods inherited from class org.apache.commons.lang3.tuple.MutablePair

        emptyArray, getLeft, getRight, of, of, ofNonNull, setLeft, setRight, setValue
      • Methods inherited from class org.apache.commons.lang3.tuple.Pair

        accept, apply, compareTo, equals, getKey, getValue, hashCode, toString
    • Constructor Detail

      • JsonAssertion

        public JsonAssertion​(String jsonPath)
        Constructs a JSON assertion without a matcher. Use to assert path existence only.
        Parameters:
        jsonPath - the JSON path
      • JsonAssertion

        public JsonAssertion​(String jsonPath,
                             org.hamcrest.Matcher<M> matcher)
        Constructs a JSON assertion with specified matcher.
        Parameters:
        jsonPath - the JSON path
        matcher - the matcher