Search in sources :

Example 11 with ReactiveAdapterRegistry

use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.

the class ErrorsArgumentResolverTests method setup.

@Before
public void setup() throws Exception {
    this.resolver = new ErrorsMethodArgumentResolver(new ReactiveAdapterRegistry());
    Foo foo = new Foo();
    WebExchangeDataBinder binder = this.bindingContext.createDataBinder(this.exchange, foo, "foo");
    this.bindingResult = binder.getBindingResult();
}
Also used : ReactiveAdapterRegistry(org.springframework.core.ReactiveAdapterRegistry) WebExchangeDataBinder(org.springframework.web.bind.support.WebExchangeDataBinder) Before(org.junit.Before)

Example 12 with ReactiveAdapterRegistry

use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.

the class ExpressionValueMethodArgumentResolverTests method setup.

@Before
public void setup() throws Exception {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    context.refresh();
    ReactiveAdapterRegistry adapterRegistry = new ReactiveAdapterRegistry();
    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);
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) ReactiveAdapterRegistry(org.springframework.core.ReactiveAdapterRegistry) Method(java.lang.reflect.Method) MethodParameter(org.springframework.core.MethodParameter) Before(org.junit.Before)

Example 13 with ReactiveAdapterRegistry

use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.

the class HttpEntityArgumentResolverTests method createResolver.

private HttpEntityArgumentResolver createResolver() {
    List<HttpMessageReader<?>> readers = new ArrayList<>();
    readers.add(new DecoderHttpMessageReader<>(new StringDecoder()));
    return new HttpEntityArgumentResolver(readers, new ReactiveAdapterRegistry());
}
Also used : HttpMessageReader(org.springframework.http.codec.HttpMessageReader) DecoderHttpMessageReader(org.springframework.http.codec.DecoderHttpMessageReader) ReactiveAdapterRegistry(org.springframework.core.ReactiveAdapterRegistry) ArrayList(java.util.ArrayList) StringDecoder(org.springframework.core.codec.StringDecoder)

Example 14 with ReactiveAdapterRegistry

use of org.springframework.core.ReactiveAdapterRegistry 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);
}
Also used : SynthesizingMethodParameter(org.springframework.core.annotation.SynthesizingMethodParameter) ReactiveAdapterRegistry(org.springframework.core.ReactiveAdapterRegistry) Method(java.lang.reflect.Method) Before(org.junit.Before)

Example 15 with ReactiveAdapterRegistry

use of org.springframework.core.ReactiveAdapterRegistry in project spring-framework by spring-projects.

the class RequestAttributeMethodArgumentResolverTests method setup.

@Before
public void setup() throws Exception {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    context.refresh();
    ReactiveAdapterRegistry adapterRegistry = new ReactiveAdapterRegistry();
    this.resolver = new RequestAttributeMethodArgumentResolver(context.getBeanFactory(), adapterRegistry);
    this.handleMethod = ReflectionUtils.findMethod(getClass(), "handleWithRequestAttribute", (Class<?>[]) null);
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) ReactiveAdapterRegistry(org.springframework.core.ReactiveAdapterRegistry) Before(org.junit.Before)

Aggregations

ReactiveAdapterRegistry (org.springframework.core.ReactiveAdapterRegistry)16 Before (org.junit.Before)10 Method (java.lang.reflect.Method)6 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)5 MethodParameter (org.springframework.core.MethodParameter)5 Test (org.junit.Test)4 SynthesizingMethodParameter (org.springframework.core.annotation.SynthesizingMethodParameter)4 BindingContext (org.springframework.web.reactive.BindingContext)4 DefaultFormattingConversionService (org.springframework.format.support.DefaultFormattingConversionService)2 ModelAttribute (org.springframework.web.bind.annotation.ModelAttribute)2 ConfigurableWebBindingInitializer (org.springframework.web.bind.support.ConfigurableWebBindingInitializer)2 Mono (reactor.core.publisher.Mono)2 ArrayList (java.util.ArrayList)1 StringDecoder (org.springframework.core.codec.StringDecoder)1 DecoderHttpMessageReader (org.springframework.http.codec.DecoderHttpMessageReader)1 HttpMessageReader (org.springframework.http.codec.HttpMessageReader)1 ServerHttpRequest (org.springframework.http.server.reactive.ServerHttpRequest)1 MockServerHttpRequest (org.springframework.mock.http.server.reactive.test.MockServerHttpRequest)1 MockServerHttpResponse (org.springframework.mock.http.server.reactive.test.MockServerHttpResponse)1 WebDataBinder (org.springframework.web.bind.WebDataBinder)1