use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.
the class RequestAttributeMethodArgumentResolverTests method setup.
@BeforeEach
@SuppressWarnings("resource")
public void setup() throws Exception {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.refresh();
ReactiveAdapterRegistry registry = ReactiveAdapterRegistry.getSharedInstance();
this.resolver = new RequestAttributeMethodArgumentResolver(context.getBeanFactory(), registry);
}
use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.
the class InitBinderBindingContextTests method createBinderTypeConversion.
@Test
public void createBinderTypeConversion() throws Exception {
MockServerHttpRequest request = MockServerHttpRequest.get("/path?requestParam=22").build();
MockServerWebExchange exchange = MockServerWebExchange.from(request);
ReactiveAdapterRegistry adapterRegistry = ReactiveAdapterRegistry.getSharedInstance();
this.argumentResolvers.add(new RequestParamMethodArgumentResolver(null, adapterRegistry, false));
BindingContext context = createBindingContext("initBinderTypeConversion", WebDataBinder.class, int.class);
WebDataBinder dataBinder = context.createDataBinder(exchange, null, "foo");
assertThat(dataBinder.getDisallowedFields()).isNotNull();
assertThat(dataBinder.getDisallowedFields()[0]).isEqualTo("requestParam-22");
}
use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.
the class RequestPartMethodArgumentResolverTests method setup.
@BeforeEach
void setup() {
List<HttpMessageReader<?>> readers = ServerCodecConfigurer.create().getReaders();
ReactiveAdapterRegistry registry = ReactiveAdapterRegistry.getSharedInstance();
this.resolver = new RequestPartMethodArgumentResolver(readers, registry);
List<HttpMessageWriter<?>> writers = ClientCodecConfigurer.create().getWriters();
this.writer = new MultipartHttpMessageWriter(writers);
}
use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.
the class ExpressionValueMethodArgumentResolverTests method setup.
@BeforeEach
@SuppressWarnings("resource")
public void setup() throws Exception {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.refresh();
ReactiveAdapterRegistry adapterRegistry = ReactiveAdapterRegistry.getSharedInstance();
this.resolver = new ExpressionValueMethodArgumentResolver(context.getBeanFactory(), adapterRegistry);
Method method = ReflectionUtils.findMethod(getClass(), "params", (Class<?>[]) null);
this.paramSystemProperty = new MethodParameter(method, 0);
this.paramNotSupported = new MethodParameter(method, 1);
this.paramAlsoNotSupported = new MethodParameter(method, 2);
}
Aggregations