Skip to content

Commit 0fc21de

Browse files
committed
Upgrade to Spring Framework 7.0.0-M4
1 parent 5aba1e8 commit 0fc21de

File tree

7 files changed

+34
-33
lines changed

7 files changed

+34
-33
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ description = "Spring for GraphQL"
22

33
ext {
44
moduleProjects = [project(":spring-graphql"), project(":spring-graphql-test")]
5-
springFrameworkVersion = "6.2.6"
5+
springFrameworkVersion = "7.0.0-M4"
66
graphQlJavaVersion = "23.1"
77
springBootVersion = "3.4.3"
88
}

platform/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ dependencies {
2727
api("com.graphql-java:graphql-java:${graphQlJavaVersion}")
2828
api("io.micrometer:context-propagation:1.1.3")
2929

30-
api("jakarta.annotation:jakarta.annotation-api:2.1.1")
31-
api("jakarta.servlet:jakarta.servlet-api:6.0.0")
32-
api("jakarta.validation:jakarta.validation-api:3.0.2")
33-
api("jakarta.persistence:jakarta.persistence-api:3.1.0")
30+
api("jakarta.annotation:jakarta.annotation-api:3.0.0")
31+
api("jakarta.servlet:jakarta.servlet-api:6.1.0")
32+
api("jakarta.validation:jakarta.validation-api:3.1.0")
33+
api("jakarta.persistence:jakarta.persistence-api:3.2.0")
3434

3535
api("com.apollographql.federation:federation-graphql-java-support:5.3.0")
3636
api("com.netflix.graphql.dgs.codegen:graphql-dgs-codegen-shared-core:7.0.3")
@@ -44,8 +44,8 @@ dependencies {
4444
api("com.squareup.okhttp3:mockwebserver:4.12.0")
4545

4646
api("com.h2database:h2:2.3.232")
47-
api("org.hibernate:hibernate-core:6.6.11.Final")
48-
api("org.hibernate.validator:hibernate-validator:8.0.2.Final")
47+
api("org.hibernate.orm:hibernate-core:7.0.0.CR1")
48+
api("org.hibernate.validator:hibernate-validator:9.0.0.CR1")
4949
api("org.mongodb:bson:5.3.1")
5050
api("org.mongodb:mongodb-driver-core:5.3.1")
5151
api("org.mongodb:mongodb-driver-reactivestreams:5.3.1")

spring-graphql/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ dependencies {
6262
}
6363
testImplementation 'io.micrometer:micrometer-tracing-test'
6464
testImplementation 'com.h2database:h2'
65-
testImplementation 'org.hibernate:hibernate-core'
65+
testImplementation 'org.hibernate.orm:hibernate-core'
6666
testImplementation 'org.hibernate.validator:hibernate-validator'
6767
testImplementation 'org.springframework.data:spring-data-mongodb'
6868
testImplementation 'org.springframework.data:spring-data-neo4j'

spring-graphql/src/test/java/org/springframework/graphql/data/method/annotation/support/SchemaMappingBeanFactoryInitializationAotProcessorTests.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -571,14 +571,13 @@ private void processBeanClasses(Class<?>... beanClasses) {
571571
}
572572

573573
private void assertThatIntrospectionOnMethodsHintRegisteredForType(Class<?> type) {
574-
Predicate<RuntimeHints> predicate = RuntimeHintsPredicates.reflection()
575-
.onType(type).withAnyMemberCategory(MemberCategory.INTROSPECT_DECLARED_METHODS);
574+
Predicate<RuntimeHints> predicate = RuntimeHintsPredicates.reflection().onType(type);
576575
assertThat(predicate).accepts(this.generationContext.getRuntimeHints());
577576
}
578577

579578
private void assertThatInvocationHintRegisteredForMethods(Class<?> type, String... methodNames) {
580579
Predicate<RuntimeHints> predicate = Arrays.stream(methodNames)
581-
.map(methodName -> (Predicate<RuntimeHints>) RuntimeHintsPredicates.reflection().onMethod(type, methodName))
580+
.map(methodName -> RuntimeHintsPredicates.reflection().onMethodInvocation(type, methodName))
582581
.reduce(Predicate::and)
583582
.orElseThrow(() -> new IllegalArgumentException("Could not generate predicate on type " + type + " for methods " + Arrays.toString(methodNames)));
584583
assertThat(predicate).accepts(this.generationContext.getRuntimeHints());
@@ -602,18 +601,18 @@ private void assertThatHintsAreNotRegisteredForTypes(Class<?>... types) {
602601

603602
private Predicate<RuntimeHints> javaBeanBindingOnType(Class<?> type) {
604603
Predicate<RuntimeHints> predicate = RuntimeHintsPredicates.reflection().onType(type)
605-
.withMemberCategories(MemberCategory.DECLARED_FIELDS, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
604+
.withMemberCategories(MemberCategory.ACCESS_DECLARED_FIELDS, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
606605
try {
607606
BeanInfo beanInfo = Introspector.getBeanInfo(type);
608607
PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
609608
for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
610609
Method readMethod = propertyDescriptor.getReadMethod();
611610
if (readMethod != null && readMethod.getDeclaringClass() != Object.class) {
612-
predicate = predicate.and(RuntimeHintsPredicates.reflection().onMethod(readMethod));
611+
predicate = predicate.and(RuntimeHintsPredicates.reflection().onMethodInvocation(readMethod));
613612
}
614613
Method writeMethod = propertyDescriptor.getWriteMethod();
615614
if (writeMethod != null && writeMethod.getDeclaringClass() != Object.class) {
616-
predicate = predicate.and(RuntimeHintsPredicates.reflection().onMethod(writeMethod));
615+
predicate = predicate.and(RuntimeHintsPredicates.reflection().onMethodInvocation(writeMethod));
617616
}
618617
}
619618
}

spring-graphql/src/test/java/org/springframework/graphql/server/webflux/GraphQlWebSocketHandlerTests.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,15 @@ void registerBindingReflectionOnWebSocketMessage() {
386386
new ReflectiveRuntimeHintsRegistrar().registerRuntimeHints(runtimeHints, GraphQlWebSocketHandler.class);
387387
ReflectionHintsPredicates reflection = RuntimeHintsPredicates.reflection();
388388
assertThat(reflection.onType(GraphQlWebSocketMessage.class)).accepts(runtimeHints);
389-
assertThat(reflection.onField(GraphQlWebSocketMessage.class, "id")).accepts(runtimeHints);
390-
assertThat(reflection.onMethod(GraphQlWebSocketMessage.class, "getId")).accepts(runtimeHints);
391-
assertThat(reflection.onMethod(GraphQlWebSocketMessage.class, "setId")).accepts(runtimeHints);
392-
assertThat(reflection.onField(GraphQlWebSocketMessage.class, "type")).accepts(runtimeHints);
393-
assertThat(reflection.onMethod(GraphQlWebSocketMessage.class, "getType")).accepts(runtimeHints);
394-
assertThat(reflection.onMethod(GraphQlWebSocketMessage.class, "setType")).accepts(runtimeHints);
395-
assertThat(reflection.onField(GraphQlWebSocketMessage.class, "payload")).accepts(runtimeHints);
396-
assertThat(reflection.onMethod(GraphQlWebSocketMessage.class, "getPayload")).accepts(runtimeHints);
397-
assertThat(reflection.onMethod(GraphQlWebSocketMessage.class, "setPayload")).accepts(runtimeHints);
389+
assertThat(reflection.onFieldAccess(GraphQlWebSocketMessage.class, "id")).accepts(runtimeHints);
390+
assertThat(reflection.onMethodInvocation(GraphQlWebSocketMessage.class, "getId")).accepts(runtimeHints);
391+
assertThat(reflection.onMethodInvocation(GraphQlWebSocketMessage.class, "setId")).accepts(runtimeHints);
392+
assertThat(reflection.onFieldAccess(GraphQlWebSocketMessage.class, "type")).accepts(runtimeHints);
393+
assertThat(reflection.onMethodInvocation(GraphQlWebSocketMessage.class, "getType")).accepts(runtimeHints);
394+
assertThat(reflection.onMethodInvocation(GraphQlWebSocketMessage.class, "setType")).accepts(runtimeHints);
395+
assertThat(reflection.onFieldAccess(GraphQlWebSocketMessage.class, "payload")).accepts(runtimeHints);
396+
assertThat(reflection.onMethodInvocation(GraphQlWebSocketMessage.class, "getPayload")).accepts(runtimeHints);
397+
assertThat(reflection.onMethodInvocation(GraphQlWebSocketMessage.class, "setPayload")).accepts(runtimeHints);
398398
}
399399

400400
private TestWebSocketSession handle(Flux<WebSocketMessage> input, WebGraphQlInterceptor... interceptors) {

spring-graphql/src/test/java/org/springframework/graphql/server/webmvc/GraphQlSseHandlerTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919

2020
import java.io.IOException;
21+
import java.nio.ByteBuffer;
2122
import java.nio.charset.StandardCharsets;
2223
import java.time.Duration;
2324
import java.util.List;
@@ -171,7 +172,8 @@ void shouldCancelDataFetcherPublisherWhenWritingFails() throws Exception {
171172
HttpServletResponse servletResponse = mock(HttpServletResponse.class);
172173
ServletOutputStream outputStream = mock(ServletOutputStream.class);
173174

174-
willThrow(new IOException("broken pipe")).given(outputStream).write(any());
175+
willThrow(new IOException("broken pipe")).given(outputStream).write(any(byte[].class));
176+
willThrow(new IOException("broken pipe")).given(outputStream).write(any(ByteBuffer.class));
175177
given(servletResponse.getOutputStream()).willReturn(outputStream);
176178

177179
ServerRequest request = ServerRequest.create(servletRequest, MESSAGE_READERS);

spring-graphql/src/test/java/org/springframework/graphql/server/webmvc/GraphQlWebSocketHandlerTests.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -456,15 +456,15 @@ void registerBindingReflectionOnWebSocketMessage() {
456456
new ReflectiveRuntimeHintsRegistrar().registerRuntimeHints(runtimeHints, GraphQlWebSocketHandler.class);
457457
ReflectionHintsPredicates reflection = RuntimeHintsPredicates.reflection();
458458
assertThat(reflection.onType(GraphQlWebSocketMessage.class)).accepts(runtimeHints);
459-
assertThat(reflection.onField(GraphQlWebSocketMessage.class, "id")).accepts(runtimeHints);
460-
assertThat(reflection.onMethod(GraphQlWebSocketMessage.class, "getId")).accepts(runtimeHints);
461-
assertThat(reflection.onMethod(GraphQlWebSocketMessage.class, "setId")).accepts(runtimeHints);
462-
assertThat(reflection.onField(GraphQlWebSocketMessage.class, "type")).accepts(runtimeHints);
463-
assertThat(reflection.onMethod(GraphQlWebSocketMessage.class, "getType")).accepts(runtimeHints);
464-
assertThat(reflection.onMethod(GraphQlWebSocketMessage.class, "setType")).accepts(runtimeHints);
465-
assertThat(reflection.onField(GraphQlWebSocketMessage.class, "payload")).accepts(runtimeHints);
466-
assertThat(reflection.onMethod(GraphQlWebSocketMessage.class, "getPayload")).accepts(runtimeHints);
467-
assertThat(reflection.onMethod(GraphQlWebSocketMessage.class, "setPayload")).accepts(runtimeHints);
459+
assertThat(reflection.onFieldAccess(GraphQlWebSocketMessage.class, "id")).accepts(runtimeHints);
460+
assertThat(reflection.onMethodInvocation(GraphQlWebSocketMessage.class, "getId")).accepts(runtimeHints);
461+
assertThat(reflection.onMethodInvocation(GraphQlWebSocketMessage.class, "setId")).accepts(runtimeHints);
462+
assertThat(reflection.onFieldAccess(GraphQlWebSocketMessage.class, "type")).accepts(runtimeHints);
463+
assertThat(reflection.onMethodInvocation(GraphQlWebSocketMessage.class, "getType")).accepts(runtimeHints);
464+
assertThat(reflection.onMethodInvocation(GraphQlWebSocketMessage.class, "setType")).accepts(runtimeHints);
465+
assertThat(reflection.onFieldAccess(GraphQlWebSocketMessage.class, "payload")).accepts(runtimeHints);
466+
assertThat(reflection.onMethodInvocation(GraphQlWebSocketMessage.class, "getPayload")).accepts(runtimeHints);
467+
assertThat(reflection.onMethodInvocation(GraphQlWebSocketMessage.class, "setPayload")).accepts(runtimeHints);
468468
}
469469

470470
private void handle(GraphQlWebSocketHandler handler, TextMessage... textMessages) throws Exception {

0 commit comments

Comments
 (0)