Interface GraphQlTester.Builder<B extends GraphQlTester.Builder<B>>
- Type Parameters:
B
- the type of builder
- All Known Subinterfaces:
ExecutionGraphQlServiceTester.Builder<B>
,HttpGraphQlTester.Builder<B>
,RSocketGraphQlTester.Builder<B>
,WebGraphQlTester.Builder<B>
,WebSocketGraphQlTester.Builder<B>
- All Known Implementing Classes:
AbstractGraphQlTesterBuilder
,DefaultRSocketGraphQlTesterBuilder
- Enclosing interface:
- GraphQlTester
public static interface GraphQlTester.Builder<B extends GraphQlTester.Builder<B>>
A builder to create a
GraphQlTester
instance.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build theGraphQlTester
.documentSource
(DocumentSource contentLoader) Configure aDocumentSource
for use withGraphQlTester.documentName(String)
for resolving a document by name.errorFilter
(Predicate<ResponseError> predicate) Configure a globalfilter
that applies to all requests.responseTimeout
(Duration timeout) Max amount of time to wait for a GraphQL response.
-
Method Details
-
errorFilter
Configure a globalfilter
that applies to all requests.- Parameters:
predicate
- the error filter to add- Returns:
- the same builder instance
-
documentSource
Configure aDocumentSource
for use withGraphQlTester.documentName(String)
for resolving a document by name.By default, this is set to
ResourceDocumentSource
with classpath location"graphql-test/"
andResourceDocumentSource.FILE_EXTENSIONS
as extensions.- Parameters:
contentLoader
- the document content loader
-
responseTimeout
Max amount of time to wait for a GraphQL response.By default this is set to 5 seconds.
- Parameters:
timeout
- the response timeout value
-
build
GraphQlTester build()Build theGraphQlTester
.- Returns:
- the created instance
-