diff --git a/build.gradle b/build.gradle index 67407134..d82a194c 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { ext { moduleProjects = [project(":spring-graphql"), project(":spring-graphql-test")] - bootVersion = "2.5.5" + bootVersion = "2.6.0-RC1" graphQlJavaVersion = "17.3" } @@ -56,11 +56,12 @@ configure(moduleProjects) { dependencyManagement { imports { - mavenBom "com.fasterxml.jackson:jackson-bom:2.12.5" - mavenBom "io.projectreactor:reactor-bom:2020.0.11" - mavenBom "org.springframework:spring-framework-bom:5.3.10" + mavenBom "com.fasterxml.jackson:jackson-bom:2.13.0" + mavenBom "io.projectreactor:reactor-bom:2020.0.12" + mavenBom "org.springframework:spring-framework-bom:5.3.12" mavenBom "org.springframework.data:spring-data-bom:2021.1.0-RC1" - mavenBom "org.springframework.security:spring-security-bom:5.5.2" + mavenBom "org.springframework.security:spring-security-bom:5.6.0-RC1" + mavenBom "com.querydsl:querydsl-bom:5.0.0" mavenBom "org.jetbrains.kotlin:kotlin-bom:1.5.31" mavenBom "org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.5.2" mavenBom "org.junit:junit-bom:5.8.1" @@ -70,21 +71,16 @@ configure(moduleProjects) { dependency "javax.annotation:javax.annotation-api:1.3.2" dependency "javax.servlet:javax.servlet-api:4.0.1" dependency "com.google.code.findbugs:jsr305:3.0.2" - dependency "org.assertj:assertj-core:3.20.2" + dependency "org.assertj:assertj-core:3.21.0" dependency "com.jayway.jsonpath:json-path:2.5.0" dependency "org.skyscreamer:jsonassert:1.5.0" - dependencySet(group: 'com.querydsl', version: '4.4.0') { - entry 'querydsl-apt' - entry 'querydsl-collections' - entry 'querydsl-core' - } dependencySet(group: 'org.apache.logging.log4j', version: '2.14.1') { entry 'log4j-api' entry 'log4j-core' entry 'log4j-jul' entry 'log4j-slf4j-impl' } - dependencySet(group: 'org.mockito', version: '3.11.2') { + dependencySet(group: 'org.mockito', version: '4.0.0') { entry 'mockito-core' entry 'mockito-inline' entry 'mockito-junit-jupiter' diff --git a/graphql-spring-boot-starter/build.gradle b/graphql-spring-boot-starter/build.gradle index 1b4cf617..95443ffe 100644 --- a/graphql-spring-boot-starter/build.gradle +++ b/graphql-spring-boot-starter/build.gradle @@ -50,7 +50,7 @@ dependencies { compileOnly 'org.springframework.boot:spring-boot-test' compileOnly 'org.springframework.boot:spring-boot-test-autoconfigure' - compileOnly 'com.google.code.findbugs:jsr305' + compileOnly 'com.google.code.findbugs:jsr305:3.0.2' annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' annotationProcessor 'org.springframework.boot:spring-boot-autoconfigure-processor' diff --git a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/test/tester/AutoConfigureWebGraphQlTester.java b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/test/tester/AutoConfigureWebGraphQlTester.java index 6592c2f0..80674ec3 100644 --- a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/test/tester/AutoConfigureWebGraphQlTester.java +++ b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/test/tester/AutoConfigureWebGraphQlTester.java @@ -36,7 +36,6 @@ import org.springframework.graphql.test.tester.WebGraphQlTester; * * @author Brian Clozel * @since 1.0.0 - * @see WebTestClientMockMvcAutoConfiguration * @see WebGraphQlTesterAutoConfiguration */ @Target({ElementType.TYPE, ElementType.METHOD}) diff --git a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/test/tester/WebGraphQlTesterAutoConfiguration.java b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/test/tester/WebGraphQlTesterAutoConfiguration.java index 377d1028..6aea9249 100644 --- a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/test/tester/WebGraphQlTesterAutoConfiguration.java +++ b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/test/tester/WebGraphQlTesterAutoConfiguration.java @@ -35,8 +35,8 @@ import org.springframework.web.reactive.function.client.WebClient; */ @Configuration(proxyBeanMethods = false) @ConditionalOnClass({WebClient.class, WebTestClient.class, WebGraphQlTester.class}) -@AutoConfigureAfter(value = WebTestClientMockMvcAutoConfiguration.class, - name = "org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration") +@AutoConfigureAfter(name = {"org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration", +"org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration"}) public class WebGraphQlTesterAutoConfiguration { @Bean diff --git a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/test/tester/WebTestClientMockMvcAutoConfiguration.java b/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/test/tester/WebTestClientMockMvcAutoConfiguration.java deleted file mode 100644 index e766c903..00000000 --- a/graphql-spring-boot-starter/src/main/java/org/springframework/graphql/boot/test/tester/WebTestClientMockMvcAutoConfiguration.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2020-2021 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.graphql.boot.test.tester; - -import java.util.List; - -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.test.web.reactive.server.WebTestClientBuilderCustomizer; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.test.web.reactive.server.WebTestClient; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.client.MockMvcWebTestClient; -import org.springframework.web.reactive.function.client.WebClient; - -/** - * Auto-configuration for {@link WebTestClient} support with {@link MockMvc}. - *

- * Temporary workaround for upcoming enhancement request in Spring Boot 2.6.0. - * - * @author Brian Clozel - * @since 1.0.0 - * @see Spring Boot - * 2.6.x issue - */ -@Configuration(proxyBeanMethods = false) -@ConditionalOnClass({ WebClient.class, WebTestClient.class, MockMvcWebTestClient.class }) -@AutoConfigureAfter(name = "org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientAutoConfiguration") -public class WebTestClientMockMvcAutoConfiguration { - - @Bean - @ConditionalOnMissingBean - @ConditionalOnBean(MockMvc.class) - public WebTestClient webTestClient(MockMvc mockMvc, List customizers) { - WebTestClient.Builder builder = MockMvcWebTestClient.bindTo(mockMvc); - for (WebTestClientBuilderCustomizer customizer : customizers) { - customizer.customize(builder); - } - return builder.build(); - } - -} diff --git a/graphql-spring-boot-starter/src/main/resources/META-INF/spring.factories b/graphql-spring-boot-starter/src/main/resources/META-INF/spring.factories index 3512ca76..876722b1 100644 --- a/graphql-spring-boot-starter/src/main/resources/META-INF/spring.factories +++ b/graphql-spring-boot-starter/src/main/resources/META-INF/spring.factories @@ -19,7 +19,6 @@ org.springframework.graphql.boot.test.tester.GraphQlTesterAutoConfiguration # Spring Test @AutoConfigureWebGraphQlTester org.springframework.graphql.boot.test.tester.AutoConfigureWebGraphQlTester=\ -org.springframework.graphql.boot.test.tester.WebTestClientMockMvcAutoConfiguration,\ org.springframework.graphql.boot.test.tester.WebGraphQlTesterAutoConfiguration # Spring Test ContextCustomizerFactories diff --git a/samples/webmvc-http/build.gradle b/samples/webmvc-http/build.gradle index 4edee3f3..ab59803a 100644 --- a/samples/webmvc-http/build.gradle +++ b/samples/webmvc-http/build.gradle @@ -13,9 +13,6 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-hateoas' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-actuator' - // TODO: Remove after upgrade to Spring Boot 2.6 - implementation 'org.springframework.data:spring-data-commons:2.6.0-RC1' - implementation 'org.springframework.data:spring-data-jpa:2.6.0-RC1' implementation 'com.querydsl:querydsl-core' implementation 'com.querydsl:querydsl-jpa' developmentOnly 'org.springframework.boot:spring-boot-devtools' @@ -24,7 +21,7 @@ dependencies { testImplementation 'org.springframework:spring-webflux' testImplementation 'org.springframework.boot:spring-boot-starter-test' - annotationProcessor 'com.querydsl:querydsl-apt:4.4.0:jpa', + annotationProcessor 'com.querydsl:querydsl-apt:5.0.0:jpa', 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final', 'javax.annotation:javax.annotation-api' } diff --git a/spring-graphql-docs/src/docs/asciidoc/boot-starter.adoc b/spring-graphql-docs/src/docs/asciidoc/boot-starter.adoc index 9ec8014f..6fa6768a 100644 --- a/spring-graphql-docs/src/docs/asciidoc/boot-starter.adoc +++ b/spring-graphql-docs/src/docs/asciidoc/boot-starter.adoc @@ -1,7 +1,8 @@ [[boot-graphql]] = Boot Starter -This projects builds on Boot 2.5.x, but it should be compatible with the latest Boot 2.4.x. +This projects builds on Boot 2.6.x, but it should be compatible with the latest Boot 2.4.x. +For QueryDSL-related features, Spring Data 2021.1.0 or later is required. diff --git a/spring-graphql-docs/src/docs/asciidoc/index.adoc b/spring-graphql-docs/src/docs/asciidoc/index.adoc index 6dab6f02..df69ad72 100644 --- a/spring-graphql-docs/src/docs/asciidoc/index.adoc +++ b/spring-graphql-docs/src/docs/asciidoc/index.adoc @@ -22,6 +22,16 @@ problem, discuss a design issue, or request a feature. To get started, please see the <> and the <> sections. +[[requirements]] +== Requirements + +Spring GraphQL requires the following as a baseline: + +* JDK8 +* Spring Framework 5.3 +* GraphQL Java 17 +* Spring Data 2021.1.0 or later for QueryDSL features + [[web-transports]] diff --git a/spring-graphql/src/test/java/org/springframework/graphql/data/method/annotation/support/GraphQlArgumentInstantiatorTests.java b/spring-graphql/src/test/java/org/springframework/graphql/data/method/annotation/support/GraphQlArgumentInstantiatorTests.java index bdd2e99b..dd5ae62a 100644 --- a/spring-graphql/src/test/java/org/springframework/graphql/data/method/annotation/support/GraphQlArgumentInstantiatorTests.java +++ b/spring-graphql/src/test/java/org/springframework/graphql/data/method/annotation/support/GraphQlArgumentInstantiatorTests.java @@ -67,7 +67,7 @@ class GraphQlArgumentInstantiatorTests { String payload = "{\"noPrimary\": { \"name\": \"test\"} }"; DataFetchingEnvironment environment = initEnvironment(payload); assertThatThrownBy(() -> instantiator.instantiate(environment.getArgument("noPrimary"), NoPrimaryConstructor.class)) - .isInstanceOf(IllegalStateException.class).hasMessageContaining("No primary or single public constructor found"); + .isInstanceOf(IllegalStateException.class).hasMessageContaining("No primary or single unique constructor found"); } @Test