Interface GraphQlTester.Path
- All Superinterfaces:
- GraphQlTester.Traversable
- Enclosing interface:
- GraphQlTester
Options available to assert the response values at the current path.
- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev, Brian Clozel
- 
Method SummaryModifier 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-nullvalue 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 anullvalue at the current path.Methods inherited from interface org.springframework.graphql.test.tester.GraphQlTester.Traversablepath, path
- 
Method Details- 
hasValueGraphQlTester.Path hasValue()Verify there is anon-nullvalue or a non-empty list at the current path.- Returns:
- the same Pathspec for further assertions
 
- 
valueIsNullGraphQlTester.Path valueIsNull()Verify there is anullvalue at the current path.
- 
pathDoesNotExistGraphQlTester.Path pathDoesNotExist()Verify the current path does not exist.- Returns:
- the same Pathspec for further assertions
 
- 
entityConvert 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 Entityspec to verify the decoded value with
 
- 
entityConvert 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 Entityspec to verify the decoded value with
 
- 
entityListConvert 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 EntityListspec to verify the decoded values with
 
- 
entityListConvert 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 EntityListspec to verify the decoded values with
 
- 
matchesJsonParse 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:
- Traversablespec to select a different path
- See Also:
 
- 
matchesJsonStrictlyParse 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:
- Traversablespec to select a different path
- See Also:
 
 
-