Class DefaultRSocketGraphQlTesterBuilder
java.lang.Object
org.springframework.graphql.test.tester.AbstractGraphQlTesterBuilder<DefaultRSocketGraphQlTesterBuilder>
org.springframework.graphql.test.tester.DefaultRSocketGraphQlTesterBuilder
- All Implemented Interfaces:
GraphQlTester.Builder<DefaultRSocketGraphQlTesterBuilder>
,RSocketGraphQlTester.Builder<DefaultRSocketGraphQlTesterBuilder>
public class DefaultRSocketGraphQlTesterBuilder
extends AbstractGraphQlTesterBuilder<DefaultRSocketGraphQlTesterBuilder>
implements RSocketGraphQlTester.Builder<DefaultRSocketGraphQlTesterBuilder>
Default implementation of
RSocketGraphQlTester.Builder
that wraps
an RSocketGraphQlClient.Builder
.- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorDescriptionDefaultRSocketGraphQlTesterBuilder
(RSocketGraphQlClient rsocketGraphQlClient) Constructor to mutate. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build theRSocketGraphQlTester
instance.clientTransport
(io.rsocket.transport.ClientTransport clientTransport) Use a givenClientTransport
to communicate with the remote server.dataMimeType
(MimeType dataMimeType) Customize the format of data payloads for the connection.Customize the route to specify in the metadata of each request so the server can route it to the handler for GraphQL requests.rsocketRequester
(Consumer<RSocketRequester.Builder> requesterConsumer) Customize the underlyingRSocketRequester
to use.Select TCP as the underlying network protocol.Select WebSocket as the underlying network protocol.Methods inherited from class org.springframework.graphql.test.tester.AbstractGraphQlTesterBuilder
asTransport, buildGraphQlTester, configureJsonPathConfig, documentSource, errorFilter, getBuilderInitializer, responseTimeout
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.graphql.test.tester.GraphQlTester.Builder
documentSource, errorFilter, responseTimeout
-
Constructor Details
-
DefaultRSocketGraphQlTesterBuilder
Constructor to mutate.- Parameters:
rsocketGraphQlClient
- the underlying client with the current state
-
-
Method Details
-
tcp
Description copied from interface:RSocketGraphQlTester.Builder
Select TCP as the underlying network protocol.- Specified by:
tcp
in interfaceRSocketGraphQlTester.Builder<DefaultRSocketGraphQlTesterBuilder>
- Parameters:
host
- the remote host to connect toport
- the remote port to connect to- Returns:
- the same builder instance
-
webSocket
Description copied from interface:RSocketGraphQlTester.Builder
Select WebSocket as the underlying network protocol.- Specified by:
webSocket
in interfaceRSocketGraphQlTester.Builder<DefaultRSocketGraphQlTesterBuilder>
- Parameters:
uri
- the URL for the WebSocket handshake- Returns:
- the same builder instance
-
clientTransport
public DefaultRSocketGraphQlTesterBuilder clientTransport(io.rsocket.transport.ClientTransport clientTransport) Description copied from interface:RSocketGraphQlTester.Builder
Use a givenClientTransport
to communicate with the remote server.- Specified by:
clientTransport
in interfaceRSocketGraphQlTester.Builder<DefaultRSocketGraphQlTesterBuilder>
- Parameters:
clientTransport
- the transport to use- Returns:
- the same builder instance
-
dataMimeType
Description copied from interface:RSocketGraphQlTester.Builder
Customize the format of data payloads for the connection.By default, this is set to
"application/graphql+json"
but it can be changed to"application/json"
if necessary.- Specified by:
dataMimeType
in interfaceRSocketGraphQlTester.Builder<DefaultRSocketGraphQlTesterBuilder>
- Parameters:
dataMimeType
- the mime type to use- Returns:
- the same builder instance
-
route
Description copied from interface:RSocketGraphQlTester.Builder
Customize the route to specify in the metadata of each request so the server can route it to the handler for GraphQL requests.- Specified by:
route
in interfaceRSocketGraphQlTester.Builder<DefaultRSocketGraphQlTesterBuilder>
- Parameters:
route
- the route- Returns:
- the same builder instance
-
rsocketRequester
public DefaultRSocketGraphQlTesterBuilder rsocketRequester(Consumer<RSocketRequester.Builder> requesterConsumer) Description copied from interface:RSocketGraphQlTester.Builder
Customize the underlyingRSocketRequester
to use.Note that some properties of
RSocketRequester.Builder
like the data MimeType, and the underlying RSocket transport can be customized through this builder.- Specified by:
rsocketRequester
in interfaceRSocketGraphQlTester.Builder<DefaultRSocketGraphQlTesterBuilder>
- Parameters:
requesterConsumer
- a consumer that customizes theRSocketRequester
through its builder- Returns:
- the same builder instance
- See Also:
-
build
Description copied from interface:RSocketGraphQlTester.Builder
Build theRSocketGraphQlTester
instance.- Specified by:
build
in interfaceGraphQlTester.Builder<DefaultRSocketGraphQlTesterBuilder>
- Specified by:
build
in interfaceRSocketGraphQlTester.Builder<DefaultRSocketGraphQlTesterBuilder>
- Returns:
- the created instance
-