Class JsonObjectAssertion

    • Field Summary

      • Fields inherited from class org.assertj.core.api.AbstractAssert

        info, myself
    • Method Detail

      • hasPathWithValue

        public JsonObjectAssertion hasPathWithValue​(java.lang.String path,
                                                    java.lang.String value)
      • hasPathWithValueContaining

        public JsonObjectAssertion hasPathWithValueContaining​(java.lang.String path,
                                                              java.lang.String value)
      • pathContainsMatchingElement

        public JsonObjectAssertion pathContainsMatchingElement​(java.lang.String path,
                                                               com.jayway.jsonpath.Filter filter)
        Verifies whether the specified path pointing to a JSON array/collection element contains an element matching the condition.
        Parameters:
        path - a path to verify
        filter - a condition to be satisfied by at least one path value element.
        Returns:
        the assertion for verification of this condition
      • hasPath

        public JsonObjectAssertion hasPath​(java.lang.String path)
        Verifies whether the specified path exists and resolves to a value in the context JsonObject.
        Parameters:
        path - a path to check.
        Returns:
        the assertion for verififcation of this condition.
      • doesNotHavePath

        public JsonObjectAssertion doesNotHavePath​(java.lang.String path)
        Verifies whether the specified path does not exist or does not resolve to a value in the context JsonObject.
        Parameters:
        path - a path to check.
        Returns:
        the assertion for verififcation of this condition.
      • pathHasSize

        public JsonObjectAssertion pathHasSize​(java.lang.String path,
                                               int numExpectedEntries)
        Verifies whether the specified path contains a JSON array/collection of the expected size.
        Parameters:
        path - a path to check in the context JSON object.
        numExpectedEntries - number of elements expected in the path
        Returns:
        the assertion for verification of this condition
      • hasEmptyCollectionForPath

        public JsonObjectAssertion hasEmptyCollectionForPath​(java.lang.String path)
      • hasPathContainingExactly

        public JsonObjectAssertion hasPathContainingExactly​(java.lang.String path,
                                                            java.lang.Object... expected)
      • hasPathContainingExactly

        public JsonObjectAssertion hasPathContainingExactly​(java.lang.String path,
                                                            java.util.List<java.lang.Object> expected)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object