use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.
the class RequestHeaderMapMethodArgumentResolverTests method setup.
@Before
public void setup() throws Exception {
resolver = new RequestHeaderMapMethodArgumentResolver(new ReactiveAdapterRegistry());
Method method = ReflectionUtils.findMethod(getClass(), "params", (Class<?>[]) null);
paramMap = new SynthesizingMethodParameter(method, 0);
paramMultiValueMap = new SynthesizingMethodParameter(method, 1);
paramHttpHeaders = new SynthesizingMethodParameter(method, 2);
paramUnsupported = new SynthesizingMethodParameter(method, 3);
paramUnsupported = new SynthesizingMethodParameter(method, 3);
paramAlsoUnsupported = new SynthesizingMethodParameter(method, 4);
}
use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.
the class RequestHeaderMethodArgumentResolverTests method setup.
@Before
public void setup() throws Exception {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.refresh();
ReactiveAdapterRegistry adapterRegistry = new ReactiveAdapterRegistry();
this.resolver = new RequestHeaderMethodArgumentResolver(context.getBeanFactory(), adapterRegistry);
ConfigurableWebBindingInitializer initializer = new ConfigurableWebBindingInitializer();
initializer.setConversionService(new DefaultFormattingConversionService());
this.bindingContext = new BindingContext(initializer);
Method method = ReflectionUtils.findMethod(getClass(), "params", (Class<?>[]) null);
this.paramNamedDefaultValueStringHeader = new SynthesizingMethodParameter(method, 0);
this.paramNamedValueStringArray = new SynthesizingMethodParameter(method, 1);
this.paramSystemProperty = new SynthesizingMethodParameter(method, 2);
this.paramResolvedNameWithExpression = new SynthesizingMethodParameter(method, 3);
this.paramResolvedNameWithPlaceholder = new SynthesizingMethodParameter(method, 4);
this.paramNamedValueMap = new SynthesizingMethodParameter(method, 5);
this.paramDate = new SynthesizingMethodParameter(method, 6);
this.paramInstant = new SynthesizingMethodParameter(method, 7);
this.paramMono = new SynthesizingMethodParameter(method, 8);
}
use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.
the class SessionAttributeMethodArgumentResolverTests method setup.
@Before
public void setup() throws Exception {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.refresh();
ReactiveAdapterRegistry adapterRegistry = new ReactiveAdapterRegistry();
this.resolver = new SessionAttributeMethodArgumentResolver(context.getBeanFactory(), adapterRegistry);
this.session = mock(WebSession.class);
WebSessionManager sessionManager = new MockWebSessionManager(this.session);
ServerHttpRequest request = MockServerHttpRequest.get("/").build();
this.exchange = new DefaultServerWebExchange(request, new MockServerHttpResponse(), sessionManager);
this.handleMethod = ReflectionUtils.findMethod(getClass(), "handleWithSessionAttribute", (Class<?>[]) null);
}
use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.
the class RequestParamMethodArgumentResolverTests method doesNotSupportParameterWithDefaultResolutionTurnedOff.
@Test
public void doesNotSupportParameterWithDefaultResolutionTurnedOff() {
ReactiveAdapterRegistry adapterRegistry = new ReactiveAdapterRegistry();
this.resolver = new RequestParamMethodArgumentResolver(null, adapterRegistry, false);
MethodParameter param = this.testMethod.annotNotPresent(RequestParam.class).arg(String.class);
assertFalse(this.resolver.supportsParameter(param));
}
use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.
the class InitBinderBindingContextTests method createBinderTypeConversion.
@Test
public void createBinderTypeConversion() throws Exception {
ServerWebExchange exchange = MockServerHttpRequest.get("/path?requestParam=22").toExchange();
ReactiveAdapterRegistry adapterRegistry = new ReactiveAdapterRegistry();
this.argumentResolvers.add(new RequestParamMethodArgumentResolver(null, adapterRegistry, false));
BindingContext context = createBindingContext("initBinderTypeConversion", WebDataBinder.class, int.class);
WebDataBinder dataBinder = context.createDataBinder(exchange, null, "foo");
assertNotNull(dataBinder.getDisallowedFields());
assertEquals("requestParam-22", dataBinder.getDisallowedFields()[0]);
}
Aggregations