Class RouterFunctionMockMvcBuilder

All Implemented Interfaces:
MockMvcBuilder, ConfigurableMockMvcBuilder<RouterFunctionMockMvcBuilder>

public class RouterFunctionMockMvcBuilder extends AbstractMockMvcBuilder<RouterFunctionMockMvcBuilder>
A MockMvcBuilder that accepts RouterFunction registrations thus allowing full control over the instantiation and initialization of router functions and their dependencies similar to plain unit tests, and also making it possible to test one function at a time.

This builder creates the minimum infrastructure required by the DispatcherServlet to serve requests with router functions and also provides methods for customization. The resulting configuration and customization options are equivalent to using MVC Java config except using builder style methods.

To configure view resolution, either select a "fixed" view to use for every request performed (see setSingleView(View)) or provide a list of ViewResolvers (see setViewResolvers(ViewResolver...)).

Since:
6.2
Author:
Arjen Poutsma