Rename method for adding custom argument resolvers

See gh-603
This commit is contained in:
rstoyanchev
2023-03-10 13:45:24 +00:00
parent 052b1f09b7
commit 038250e23d
2 changed files with 6 additions and 7 deletions

View File

@@ -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<HandlerMethodArgumentResolver> resolvers) {
this.customArgumentResolvers.addAll(resolvers);
public void addCustomArgumentResolver(HandlerMethodArgumentResolver resolver) {
this.customArgumentResolvers.add(resolver);
}
HandlerMethodArgumentResolverComposite getArgumentResolvers() {

View File

@@ -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();