Rename method for adding custom argument resolvers
See gh-603
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user