Skip to content

Commit 038250e

Browse files
committed
Rename method for adding custom argument resolvers
See gh-603
1 parent 052b1f0 commit 038250e

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

spring-graphql/src/main/java/org/springframework/graphql/data/method/annotation/support/AnnotatedControllerConfigurer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ public void addFormatterRegistrar(FormatterRegistrar registrar) {
153153
}
154154

155155
/**
156-
* Add {@link HandlerMethodArgumentResolver}'s for custom controller method
156+
* Add a {@link HandlerMethodArgumentResolver} for custom controller method
157157
* arguments. Such custom resolvers are ordered after built-in resolvers
158158
* except for {@link SourceMethodArgumentResolver}, which is always last.
159159
*
160-
* @param resolvers the resolvers to add.
160+
* @param resolver the resolver to add.
161161
* @since 1.2
162162
*/
163-
public void setCustomArgumentResolver(List<HandlerMethodArgumentResolver> resolvers) {
164-
this.customArgumentResolvers.addAll(resolvers);
163+
public void addCustomArgumentResolver(HandlerMethodArgumentResolver resolver) {
164+
this.customArgumentResolvers.add(resolver);
165165
}
166166

167167
HandlerMethodArgumentResolverComposite getArgumentResolvers() {

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.springframework.graphql.data.method.annotation.support;
1717

18-
import java.util.Collections;
1918
import java.util.List;
2019

2120
import org.junit.jupiter.api.Test;
@@ -41,8 +40,8 @@ void customArgumentResolvers() {
4140
HandlerMethodArgumentResolver customResolver2 = mock(HandlerMethodArgumentResolver.class);
4241

4342
AnnotatedControllerConfigurer configurer = new AnnotatedControllerConfigurer();
44-
configurer.setCustomArgumentResolver(Collections.singletonList(customResolver1));
45-
configurer.setCustomArgumentResolver(Collections.singletonList(customResolver2));
43+
configurer.addCustomArgumentResolver(customResolver1);
44+
configurer.addCustomArgumentResolver(customResolver2);
4645
configurer.setApplicationContext(new StaticApplicationContext());
4746
configurer.afterPropertiesSet();
4847

0 commit comments

Comments
 (0)