Skip to content

Commit d733172

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

File tree

4 files changed

+24
-25
lines changed

4 files changed

+24
-25
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
}

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/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)