Interface GraphQlTester.Path

All Superinterfaces:
GraphQlTester.Traversable
Enclosing interface:
GraphQlTester

public static interface GraphQlTester.Path extends GraphQlTester.Traversable
Options available to assert the response values at the current path.
  • Method Details

    • hasValue

      GraphQlTester.Path hasValue()
      Verify there is a non-null value or a non-empty list at the current path.
      Returns:
      the same Path spec for further assertions
    • valueIsNull

      GraphQlTester.Path valueIsNull()
      Verify there is a null value at the current path.
    • pathDoesNotExist

      GraphQlTester.Path pathDoesNotExist()
      Verify the current path does not exist.
      Returns:
      the same Path spec for further assertions
    • entity

      <D> GraphQlTester.Entity<D,?> entity(Class<D> entityType)
      Convert the data at the given path to the target type.
      Type Parameters:
      D - the target entity type
      Parameters:
      entityType - the type to convert to
      Returns:
      an Entity spec to verify the decoded value with
    • entity

      <D> GraphQlTester.Entity<D,?> entity(ParameterizedTypeReference<D> entityType)
      Convert the data at the given path to the target type.
      Type Parameters:
      D - the target entity type
      Parameters:
      entityType - the type to convert to
      Returns:
      an Entity spec to verify the decoded value with
    • entityList

      <D> GraphQlTester.EntityList<D> entityList(Class<D> elementType)
      Convert the data at the given path to a List of the target type.
      Type Parameters:
      D - the target entity type
      Parameters:
      elementType - the type of element to convert to
      Returns:
      an EntityList spec to verify the decoded values with
    • entityList

      <D> GraphQlTester.EntityList<D> entityList(ParameterizedTypeReference<D> elementType)
      Convert the data at the given path to a List of the target type.
      Type Parameters:
      D - the target entity type
      Parameters:
      elementType - the type to convert to
      Returns:
      an EntityList spec to verify the decoded values with
    • matchesJson

      GraphQlTester.Traversable matchesJson(String expectedJson)
      Parse the JSON at the given path and the given expected JSON and assert that the two are "similar".

      Use of this option requires the JSONassert library on to be on the classpath.

      Parameters:
      expectedJson - the expected JSON
      Returns:
      Traversable spec to select a different path
      See Also:
    • matchesJsonStrictly

      GraphQlTester.Traversable matchesJsonStrictly(String expectedJson)
      Parse the JSON at the given path and the given expected JSON and assert that the two are "similar" so they contain the same attribute-value pairs regardless of formatting, along with lenient checking, e.g. extensible and non-strict array ordering.
      Parameters:
      expectedJson - the expected JSON
      Returns:
      Traversable spec to select a different path
      See Also: