Interface GraphQlTester.Path
- All Superinterfaces:
GraphQlTester.Traversable
- Enclosing interface:
- GraphQlTester
Options available to assert the response values at the current path.
-
Method Summary
Modifier and TypeMethodDescription<D> GraphQlTester.Entity<D,
?> Convert the data at the given path to the target type.<D> GraphQlTester.Entity<D,
?> entity
(ParameterizedTypeReference<D> entityType) Convert the data at the given path to the target type.<D> GraphQlTester.EntityList<D>
entityList
(Class<D> elementType) Convert the data at the given path to a List of the target type.<D> GraphQlTester.EntityList<D>
entityList
(ParameterizedTypeReference<D> elementType) Convert the data at the given path to a List of the target type.hasValue()
Verify there is anon-null
value or a non-empty list at the current path.matchesJson
(String expectedJson) Parse the JSON at the given path and the given expected JSON and assert that the two are "similar".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.Verify the current path does not exist.Verify there is anull
value at the current path.Methods inherited from interface org.springframework.graphql.test.tester.GraphQlTester.Traversable
path, path
-
Method Details
-
hasValue
GraphQlTester.Path hasValue()Verify there is anon-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 anull
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
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
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
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
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
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
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:
-