Class JsonObjectAssertion

java.lang.Object
org.assertj.core.api.AbstractAssert<JsonObjectAssertion,JsonObject>
de.hybris.platform.integrationservices.asserts.JsonObjectAssertion
All Implemented Interfaces:
org.assertj.core.api.Assert<JsonObjectAssertion,JsonObject>, org.assertj.core.api.Descriptable<JsonObjectAssertion>, org.assertj.core.api.ExtensionPoints<JsonObjectAssertion,JsonObject>

public class JsonObjectAssertion extends org.assertj.core.api.AbstractAssert<JsonObjectAssertion,JsonObject>
Assertions for JsonObject
  • Method Details

    • assertionOf

      public static JsonObjectAssertion assertionOf(JsonObject json)
    • hasPathWithValue

      public JsonObjectAssertion hasPathWithValue(String path, String value)
    • hasPathWithValueContaining

      public JsonObjectAssertion hasPathWithValueContaining(String path, String value)
    • pathContainsMatchingElement

      public JsonObjectAssertion pathContainsMatchingElement(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(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(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(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
    • isEmpty

      public JsonObjectAssertion isEmpty()
    • hasEmptyCollectionForPath

      public JsonObjectAssertion hasEmptyCollectionForPath(String path)
    • hasPathContainingExactly

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

      public JsonObjectAssertion hasPathContainingExactly(String path, List<Object> expected)
    • toString

      public String toString()
      Overrides:
      toString in class Object