public static interface GraphQlTester.PathSpec extends GraphQlTester.TraverseSpec
Modifier and Type | Method and Description |
---|---|
<D> GraphQlTester.EntitySpec<D,?> |
entity(Class<D> entityType)
Convert the data at the given path to the target type.
|
<D> GraphQlTester.EntitySpec<D,?> |
entity(ParameterizedTypeReference<D> entityType)
Convert the data at the given path to the target type.
|
<D> GraphQlTester.ListEntitySpec<D> |
entityList(Class<D> elementType)
Convert the data at the given path to a List of the target type.
|
<D> GraphQlTester.ListEntitySpec<D> |
entityList(ParameterizedTypeReference<D> elementType)
Convert the data at the given path to a List of the target type.
|
GraphQlTester.TraverseSpec |
matchesJson(String expectedJson)
Parse the JSON at the given path and the given expected JSON and assert that
the two are "similar".
|
GraphQlTester.TraverseSpec |
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.
|
GraphQlTester.PathSpec |
pathDoesNotExist()
Assert the given path does not
exist . |
GraphQlTester.PathSpec |
pathExists()
Assert the given path exists, even if the value is
null . |
GraphQlTester.PathSpec |
valueDoesNotExist()
Assert a value does not
exist at the given path. |
GraphQlTester.PathSpec |
valueExists()
Assert a value exists at the given path where the value is any
non-null
value, possibly an empty array or map. |
GraphQlTester.PathSpec |
valueIsEmpty()
Assert the value at the given path does not exist or is empty as defined in
ObjectUtils.isEmpty(Object) . |
GraphQlTester.PathSpec |
valueIsNotEmpty()
Assert the value at the given path is not
valueIsEmpty() . |
path
GraphQlTester.PathSpec pathExists()
null
.GraphQlTester.PathSpec pathDoesNotExist()
exist
.GraphQlTester.PathSpec valueExists()
non-null
value, possibly an empty array or map.GraphQlTester.PathSpec valueDoesNotExist()
exist
at the given path.GraphQlTester.PathSpec valueIsEmpty()
ObjectUtils.isEmpty(Object)
.ObjectUtils.isEmpty(Object)
GraphQlTester.PathSpec valueIsNotEmpty()
valueIsEmpty()
.<D> GraphQlTester.EntitySpec<D,?> entity(Class<D> entityType)
D
- the target entity typeentityType
- the type to convert to<D> GraphQlTester.EntitySpec<D,?> entity(ParameterizedTypeReference<D> entityType)
D
- the target entity typeentityType
- the type to convert to<D> GraphQlTester.ListEntitySpec<D> entityList(Class<D> elementType)
D
- the target entity typeelementType
- the type of element to convert to<D> GraphQlTester.ListEntitySpec<D> entityList(ParameterizedTypeReference<D> elementType)
D
- the target entity typeelementType
- the type to convert toGraphQlTester.TraverseSpec matchesJson(String expectedJson)
Use of this option requires the JSONassert library on to be on the classpath.
expectedJson
- the expected JSONJsonExpectationsHelper.assertJsonEqual(String,
String)
GraphQlTester.TraverseSpec matchesJsonStrictly(String expectedJson)
expectedJson
- the expected JSONJsonExpectationsHelper.assertJsonEqual(String,
String, boolean)