public interface GraphQlTester
The workflow declared to prepare, execute, and verify requests is not tied
to any specific underlying transport. Use WebGraphQlTester
to test
GraphQL requests over a Web transport. This class can also be used to perform
calls directly on GraphQL
, without a transport, via
GraphQlService
.
Modifier and Type | Interface and Description |
---|---|
static interface |
GraphQlTester.Builder<T extends GraphQlTester.Builder<T>>
A builder to create a
GraphQlTester instance. |
static interface |
GraphQlTester.EntitySpec<D,S extends GraphQlTester.EntitySpec<D,S>>
Declare options available to assert data converted to an entity.
|
static interface |
GraphQlTester.ErrorSpec
Declare options to filter out expected errors or inspect all errors and verify
there are no unexpected errors.
|
static interface |
GraphQlTester.ExecuteSpec
Declare options to perform a GraphQL request.
|
static interface |
GraphQlTester.ListEntitySpec<E>
Extension of
GraphQlTester.EntitySpec with options available to assert data converted to
a List of entities. |
static interface |
GraphQlTester.PathSpec
Declare options available to assert data at a given path.
|
static interface |
GraphQlTester.RequestSpec<T extends GraphQlTester.RequestSpec<T>>
Declare options to gather input for a GraphQL request and execute it.
|
static interface |
GraphQlTester.ResponseSpec
Declare options to check the data and errors of a GraphQL response.
|
static interface |
GraphQlTester.SubscriptionSpec
Declare options available to assert a GraphQL Subscription response.
|
static interface |
GraphQlTester.TraverseSpec
Declare options to switch to different part of the GraphQL response.
|
Modifier and Type | Method and Description |
---|---|
static GraphQlTester.Builder<?> |
builder(GraphQlService service)
Return a builder with options to initialize a
GraphQlTester . |
static GraphQlTester |
create(GraphQlService service)
Create a
GraphQlTester that performs GraphQL requests through the
given GraphQlService . |
GraphQlTester.RequestSpec<?> |
query(String query)
Prepare to perform a GraphQL request with the given operation which may
be a query, mutation, or a subscription.
|
GraphQlTester.RequestSpec<?> query(String query)
query
- the operation to be performedAssertionError
- if the response status is not 200 (OK)static GraphQlTester create(GraphQlService service)
GraphQlTester
that performs GraphQL requests through the
given GraphQlService
.service
- the service to execute requests withGraphQlTester
static GraphQlTester.Builder<?> builder(GraphQlService service)
GraphQlTester
.service
- the service to execute requests with