use of org.springframework.web.bind.support.WebExchangeDataBinder in project spring-framework by spring-projects.
the class ControllerAdviceTests method initBinderAdvice.
@Test
public void initBinderAdvice() throws Exception {
ApplicationContext context = new AnnotationConfigApplicationContext(TestConfig.class);
RequestMappingHandlerAdapter adapter = createAdapter(context);
TestController controller = context.getBean(TestController.class);
Validator validator = mock(Validator.class);
controller.setValidator(validator);
BindingContext bindingContext = handle(adapter, controller, "handle").getBindingContext();
WebExchangeDataBinder binder = bindingContext.createDataBinder(this.exchange, "name");
assertEquals(Collections.singletonList(validator), binder.getValidators());
}
use of org.springframework.web.bind.support.WebExchangeDataBinder 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();
}
Aggregations