-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Description
Reijhanniel Jearl Campos opened SPR-17520 and commented
We're heavily using Spring MVC, and its awesome Spring MVC test. Our use case is fairly advanced, for we write our custom org.springframework.web.servlet.HandlerMapping and org.springframework.web.servlet.HandlerAdapter . To make use of Spring MVC test however, we needed to duplicate org.springframework.test.web.servlet.setup.StandaloneMockMvcBuilder just to allow customization of such beans.
I found a ticket (#16166) that similarly describes the same, albeit only for:
/**
* Configure factory to create a custom {@link RequestMappingHandlerMapping}.
* @param factory the factory
* @since 5.0
*/
public StandaloneMockMvcBuilder setCustomHandlerMapping(Supplier<RequestMappingHandlerMapping> factory) {
this.handlerMappingFactory = factory;
return this;
}We cannot use this method, because we're not relying on RequestMappingHandlerMapping and it doesn't yet have a setter for custom HandlerAdapter s.
Is there a better way to do this?
Affects: 5.1.2
Issue Links:
- Provide public methods to register and un-register handler method mappings [SPR-11541] #16166 Provide public methods to register and un-register handler method mappings
Referenced from: commits 2700993