use of org.springframework.core.annotation.SynthesizingMethodParameter in project spring-framework by spring-projects.
the class PathVariableMethodArgumentResolverTests method setup.
@Before
public void setup() throws Exception {
this.resolver = new PathVariableMethodArgumentResolver(null, new ReactiveAdapterRegistry());
Method method = ReflectionUtils.findMethod(getClass(), "handle", (Class<?>[]) null);
paramNamedString = new SynthesizingMethodParameter(method, 0);
paramString = new SynthesizingMethodParameter(method, 1);
paramNotRequired = new SynthesizingMethodParameter(method, 2);
paramOptional = new SynthesizingMethodParameter(method, 3);
paramMono = new SynthesizingMethodParameter(method, 4);
}
use of org.springframework.core.annotation.SynthesizingMethodParameter in project spring-framework by spring-projects.
the class PathVariableMethodArgumentResolverTests method setup.
@Before
public void setup() throws Exception {
resolver = new PathVariableMethodArgumentResolver();
mavContainer = new ModelAndViewContainer();
request = new MockHttpServletRequest();
webRequest = new ServletWebRequest(request, new MockHttpServletResponse());
Method method = ReflectionUtils.findMethod(getClass(), "handle", (Class<?>[]) null);
paramNamedString = new SynthesizingMethodParameter(method, 0);
paramString = new SynthesizingMethodParameter(method, 1);
paramNotRequired = new SynthesizingMethodParameter(method, 2);
paramOptional = new SynthesizingMethodParameter(method, 3);
}
use of org.springframework.core.annotation.SynthesizingMethodParameter in project spring-framework by spring-projects.
the class MatrixVariablesMapMethodArgumentResolverTests method setup.
@Before
public void setup() throws Exception {
this.resolver = new MatrixVariableMapMethodArgumentResolver();
this.mavContainer = new ModelAndViewContainer();
this.request = new MockHttpServletRequest();
this.webRequest = new ServletWebRequest(request, new MockHttpServletResponse());
Map<String, MultiValueMap<String, String>> params = new LinkedHashMap<>();
this.request.setAttribute(HandlerMapping.MATRIX_VARIABLES_ATTRIBUTE, params);
Method method = getClass().getMethod("handle", String.class, Map.class, MultiValueMap.class, MultiValueMap.class, Map.class);
this.paramString = new SynthesizingMethodParameter(method, 0);
this.paramMap = new SynthesizingMethodParameter(method, 1);
this.paramMultivalueMap = new SynthesizingMethodParameter(method, 2);
this.paramMapForPathVar = new SynthesizingMethodParameter(method, 3);
this.paramMapWithName = new SynthesizingMethodParameter(method, 4);
}
use of org.springframework.core.annotation.SynthesizingMethodParameter in project spring-framework by spring-projects.
the class AbstractRequestAttributesArgumentResolverTests method initMethodParameter.
private MethodParameter initMethodParameter(int parameterIndex) {
MethodParameter param = new SynthesizingMethodParameter(this.handleMethod, parameterIndex);
param.initParameterNameDiscovery(new DefaultParameterNameDiscoverer());
GenericTypeResolver.resolveParameterType(param, this.resolver.getClass());
return param;
}
use of org.springframework.core.annotation.SynthesizingMethodParameter in project spring-framework by spring-projects.
the class RequestHeaderMethodArgumentResolverTests method setUp.
@Before
@SuppressWarnings("resource")
public void setUp() throws Exception {
GenericWebApplicationContext context = new GenericWebApplicationContext();
context.refresh();
resolver = new RequestHeaderMethodArgumentResolver(context.getBeanFactory());
Method method = ReflectionUtils.findMethod(getClass(), "params", (Class<?>[]) null);
paramNamedDefaultValueStringHeader = new SynthesizingMethodParameter(method, 0);
paramNamedValueStringArray = new SynthesizingMethodParameter(method, 1);
paramSystemProperty = new SynthesizingMethodParameter(method, 2);
paramContextPath = new SynthesizingMethodParameter(method, 3);
paramResolvedNameWithExpression = new SynthesizingMethodParameter(method, 4);
paramResolvedNameWithPlaceholder = new SynthesizingMethodParameter(method, 5);
paramNamedValueMap = new SynthesizingMethodParameter(method, 6);
paramDate = new SynthesizingMethodParameter(method, 7);
paramInstant = new SynthesizingMethodParameter(method, 8);
servletRequest = new MockHttpServletRequest();
webRequest = new ServletWebRequest(servletRequest, new MockHttpServletResponse());
// Expose request to the current thread (for SpEL expressions)
RequestContextHolder.setRequestAttributes(webRequest);
}
Aggregations