From 038250e23d7cbf3cf2bf1954fda3e2fae1b13ba5 Mon Sep 17 00:00:00 2001 From: rstoyanchev Date: Fri, 10 Mar 2023 13:45:24 +0000 Subject: [PATCH] Rename method for adding custom argument resolvers See gh-603 --- .../annotation/support/AnnotatedControllerConfigurer.java | 8 ++++---- .../support/AnnotatedControllerConfigurerTests.java | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/support/AnnotatedControllerConfigurer.java b/spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/support/AnnotatedControllerConfigurer.java index 0fbc3e81..f6e12842 100644 --- a/spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/support/AnnotatedControllerConfigurer.java +++ b/spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/support/AnnotatedControllerConfigurer.java @@ -153,15 +153,15 @@ public class AnnotatedControllerConfigurer } /** - * Add {@link HandlerMethodArgumentResolver}'s for custom controller method + * Add a {@link HandlerMethodArgumentResolver} for custom controller method * arguments. Such custom resolvers are ordered after built-in resolvers * except for {@link SourceMethodArgumentResolver}, which is always last. * - * @param resolvers the resolvers to add. + * @param resolver the resolver to add. * @since 1.2 */ - public void setCustomArgumentResolver(List resolvers) { - this.customArgumentResolvers.addAll(resolvers); + public void addCustomArgumentResolver(HandlerMethodArgumentResolver resolver) { + this.customArgumentResolvers.add(resolver); } HandlerMethodArgumentResolverComposite getArgumentResolvers() { diff --git a/spring-graphql/src/test/java/org/springframework/graphql/data/method/annotation/support/AnnotatedControllerConfigurerTests.java b/spring-graphql/src/test/java/org/springframework/graphql/data/method/annotation/support/AnnotatedControllerConfigurerTests.java index 1678b1ad..c1ad7c79 100644 --- a/spring-graphql/src/test/java/org/springframework/graphql/data/method/annotation/support/AnnotatedControllerConfigurerTests.java +++ b/spring-graphql/src/test/java/org/springframework/graphql/data/method/annotation/support/AnnotatedControllerConfigurerTests.java @@ -15,7 +15,6 @@ */ package org.springframework.graphql.data.method.annotation.support; -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; @@ -41,8 +40,8 @@ public class AnnotatedControllerConfigurerTests { HandlerMethodArgumentResolver customResolver2 = mock(HandlerMethodArgumentResolver.class); AnnotatedControllerConfigurer configurer = new AnnotatedControllerConfigurer(); - configurer.setCustomArgumentResolver(Collections.singletonList(customResolver1)); - configurer.setCustomArgumentResolver(Collections.singletonList(customResolver2)); + configurer.addCustomArgumentResolver(customResolver1); + configurer.addCustomArgumentResolver(customResolver2); configurer.setApplicationContext(new StaticApplicationContext()); configurer.afterPropertiesSet();