Upgrade to Spring GraphQL 1.0.0-SNAPSHOT

This commit switches to 1.0.0-SNAPSHOT for Spring GraphQL, before its
upcoming 1.0.0-M6 version.

This commit adapts to the changes introduced in
spring-projects/spring-graphql#317 : now that `GraphQlClient` has been
introduced, `GraphQlTester` has been aligned with the new
infrastructure. The `@GraphQlTest` and `@SpringBootTest` testing support
is now using different variants for each.

All samples have been updated to use the proper GraphQL terminology, see
and spring-projects/spring-graphql#310 .

See gh-29637
This commit is contained in:
Brian Clozel
2022-03-07 21:05:11 +01:00
parent dfd4097436
commit 81754c8bc4
30 changed files with 213 additions and 104 deletions

View File

@@ -28,7 +28,7 @@ import org.springframework.boot.web.embedded.tomcat.TomcatReactiveWebServerFacto
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
import org.springframework.graphql.test.tester.WebGraphQlTester;
import org.springframework.graphql.test.tester.HttpGraphQlTester;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.server.reactive.ContextPathCompositeHandler;
@@ -38,21 +38,21 @@ import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.test.annotation.DirtiesContext;
/**
* Integration test for {@link WebGraphQlTesterContextCustomizer}.
* Integration test for {@link HttpGraphQlTesterContextCustomizer}.
*
* @author Brian Clozel
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = "spring.main.web-application-type=reactive")
@DirtiesContext
class WebGraphQlTesterContextCustomizerIntegrationTests {
class HttpGraphQlTesterContextCustomizerIntegrationTests {
@Autowired
WebGraphQlTester graphQlTester;
HttpGraphQlTester graphQlTester;
@Test
void shouldHandleGraphQlRequests() {
this.graphQlTester.query("{}").executeAndVerify();
this.graphQlTester.document("{}").executeAndVerify();
}
@Configuration(proxyBeanMethods = false)

View File

@@ -28,7 +28,7 @@ import org.springframework.boot.web.embedded.tomcat.TomcatReactiveWebServerFacto
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
import org.springframework.graphql.test.tester.WebGraphQlTester;
import org.springframework.graphql.test.tester.HttpGraphQlTester;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.server.reactive.ContextPathCompositeHandler;
@@ -38,21 +38,21 @@ import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.test.context.TestPropertySource;
/**
* Tests for {@link WebGraphQlTesterContextCustomizer} with a custom context path for a
* Tests for {@link HttpGraphQlTesterContextCustomizer} with a custom context path for a
* Reactive web application.
*
* @author Brian Clozel
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@TestPropertySource(properties = { "spring.main.web-application-type=reactive", "spring.webflux.base-path=/test" })
class WebGraphQlTesterContextCustomizerWithCustomBasePathTests {
class HttpGraphQlTesterContextCustomizerWithCustomBasePathTests {
@Autowired
WebGraphQlTester graphQlTester;
HttpGraphQlTester graphQlTester;
@Test
void shouldHandleGraphQlRequests() {
this.graphQlTester.query("{}").executeAndVerify();
this.graphQlTester.document("{}").executeAndVerify();
}
@Configuration(proxyBeanMethods = false)

View File

@@ -24,7 +24,7 @@ import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactor
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.graphql.test.tester.WebGraphQlTester;
import org.springframework.graphql.test.tester.HttpGraphQlTester;
import org.springframework.http.MediaType;
import org.springframework.test.context.TestPropertySource;
import org.springframework.web.bind.annotation.PostMapping;
@@ -32,21 +32,21 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.DispatcherServlet;
/**
* Tests for {@link WebGraphQlTesterContextCustomizer} with a custom context path for a
* Tests for {@link HttpGraphQlTesterContextCustomizer} with a custom context path for a
* Servlet web application.
*
* @author Brian Clozel
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@TestPropertySource(properties = "server.servlet.context-path=/test")
class WebGraphQlTesterContextCustomizerWithCustomContextPathTests {
class HttpGraphQlTesterContextCustomizerWithCustomContextPathTests {
@Autowired
WebGraphQlTester graphQlTester;
HttpGraphQlTester graphQlTester;
@Test
void shouldHandleGraphQlRequests() {
this.graphQlTester.query("{}").executeAndVerify();
this.graphQlTester.document("{}").executeAndVerify();
}
@Configuration(proxyBeanMethods = false)