Support nested paths in GraphQlTester

Closes gh-457
This commit is contained in:
rstoyanchev
2023-05-07 21:19:03 +01:00
parent 2e7b0108d9
commit 21f4520a37
4 changed files with 118 additions and 27 deletions

View File

@@ -359,6 +359,26 @@ See <<testing.errors>> for more details on error handling.
[[testing.requests.nestedPaths]]
=== Nested Paths
By default, paths are relative to the "data" section of the GraphQL response. You can also
nest down to a path, and inspect multiple paths relative to it as follows:
[source,java,indent=0,subs="verbatim,quotes"]
----
graphQlTester.document(document)
.execute()
.path("project", project -> project // <1>
.path("name").entity(String.class).isEqualTo("spring-framework")
.path("releases[*].version").entityList(String.class).hasSizeGreaterThan(1));
----
<1> Use a callback to inspect paths relative to "project".
[[testing.subscriptions]]
== Subscriptions