Class AbstractGraphQlTesterBuilder<B extends AbstractGraphQlTesterBuilder<B>>
java.lang.Object
org.springframework.graphql.test.tester.AbstractGraphQlTesterBuilder<B>
- Type Parameters:
- B- the type of builder
- All Implemented Interfaces:
- GraphQlTester.Builder<B>
- Direct Known Subclasses:
- DefaultRSocketGraphQlTesterBuilder
public abstract class AbstractGraphQlTesterBuilder<B extends AbstractGraphQlTesterBuilder<B>>
extends Object
implements GraphQlTester.Builder<B>
Abstract, base class for transport specific 
GraphQlTester.Builder
 implementations.
 Subclasses must implement GraphQlTester.Builder.build() and call
 buildGraphQlTester(GraphQlTransport) to obtain a default, transport
 agnostic GraphQlTester. A transport specific extension can then wrap
 this default tester by extending AbstractDelegatingGraphQlTester.
- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected static GraphQlTransportasTransport(GraphQlClient client) For cases where the Tester needs theGraphQlTransport, we can't use transports directly since they are package private, but we can adapt the correspondingGraphQlClientand adapt it toGraphQlTransport.protected GraphQlTesterbuildGraphQlTester(GraphQlTransport transport) Build the default transport-agnostic client that subclasses can then wrap withAbstractDelegatingGraphQlTester.protected voidconfigureJsonPathConfig(Function<com.jayway.jsonpath.Configuration, com.jayway.jsonpath.Configuration> configurer) Allow transport-specific subclass builders to register a JSON PathMappingProviderthat matches the JSON encoding/decoding they use.documentSource(DocumentSource documentSource) Configure aDocumentSourcefor use withGraphQlTester.documentName(String)for resolving a document by name.errorFilter(Predicate<ResponseError> predicate) Configure a globalfilterthat applies to all requests.protected Consumer<AbstractGraphQlTesterBuilder<?>> Subclasses call this fromGraphQlTester.Builder.build()to obtain aConsumerto initialize new builder instances with, based on "this" builder.responseTimeout(Duration timeout) Max amount of time to wait for a GraphQL response.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.graphql.test.tester.GraphQlTester.Builderbuild
- 
Constructor Details- 
AbstractGraphQlTesterBuilderpublic AbstractGraphQlTesterBuilder()
 
- 
- 
Method Details- 
errorFilterDescription copied from interface:GraphQlTester.BuilderConfigure a globalfilterthat applies to all requests.- Specified by:
- errorFilterin interface- GraphQlTester.Builder<B extends AbstractGraphQlTesterBuilder<B>>
- Parameters:
- predicate- the error filter to add
- Returns:
- the same builder instance
 
- 
documentSourceDescription copied from interface:GraphQlTester.BuilderConfigure aDocumentSourcefor use withGraphQlTester.documentName(String)for resolving a document by name.By default, this is set to ResourceDocumentSourcewith classpath location"graphql-test/"andResourceDocumentSource.FILE_EXTENSIONSas extensions.- Specified by:
- documentSourcein interface- GraphQlTester.Builder<B extends AbstractGraphQlTesterBuilder<B>>
- Parameters:
- documentSource- the document content loader
 
- 
responseTimeoutDescription copied from interface:GraphQlTester.BuilderMax amount of time to wait for a GraphQL response.By default this is set to 5 seconds. - Specified by:
- responseTimeoutin interface- GraphQlTester.Builder<B extends AbstractGraphQlTesterBuilder<B>>
- Parameters:
- timeout- the response timeout value
 
- 
configureJsonPathConfigprotected void configureJsonPathConfig(Function<com.jayway.jsonpath.Configuration, com.jayway.jsonpath.Configuration> configurer) Allow transport-specific subclass builders to register a JSON PathMappingProviderthat matches the JSON encoding/decoding they use.- Parameters:
- configurer- a function applied to the JSON Path configuration
 
- 
buildGraphQlTesterBuild the default transport-agnostic client that subclasses can then wrap withAbstractDelegatingGraphQlTester.- Parameters:
- transport- the graphql transport to use
 
- 
getBuilderInitializerSubclasses call this fromGraphQlTester.Builder.build()to obtain aConsumerto initialize new builder instances with, based on "this" builder.
- 
asTransportFor cases where the Tester needs theGraphQlTransport, we can't use transports directly since they are package private, but we can adapt the correspondingGraphQlClientand adapt it toGraphQlTransport.- Parameters:
- client- the graphql client to use for extracting the transport
 
 
-