Polishing

This commit is contained in:
rstoyanchev
2022-03-10 09:48:37 +00:00
parent fb521e9b6f
commit 1e652f800b
2 changed files with 16 additions and 2 deletions

View File

@@ -16,7 +16,9 @@
package io.spring.sample.graphql;
import java.net.URI;
import java.time.Duration;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -38,8 +40,7 @@ class WebFluxSecuritySampleTests {
@LocalServerPort
private int port;
@Autowired
private WebGraphQlTester graphQlTester;
private WebSocketGraphQlTester graphQlTester;
@BeforeEach
public void setUp() {
@@ -47,6 +48,11 @@ class WebFluxSecuritySampleTests {
this.graphQlTester = WebSocketGraphQlTester.create(url, new ReactorNettyWebSocketClient());
}
@AfterEach
void tearDown() {
this.graphQlTester.stop().block(Duration.ofSeconds(5));
}
@Test
void printError() {
this.graphQlTester.documentName("employeesNamesAndSalaries")

View File

@@ -48,6 +48,14 @@ public interface HttpGraphQlClient extends WebGraphQlClient {
return new DefaultHttpGraphQlClient.Builder();
}
/**
* Variant of {@link #builder()} with a pre-configured {@code WebClient}
* to mutate and customize further through the returned builder.
*/
static Builder<?> builder(WebClient webClient) {
return builder(webClient.mutate());
}
/**
* Variant of {@link #builder()} with a pre-configured {@code WebClient}
* to mutate and customize further through the returned builder.