I have a custom RequestMappingHandlerMapping class that interprets a special annotation as part of its controller method mapping criteria. This annotation is the only differentiation between multiple controller methods, and without it I get "ambiguous mapping" errors. But when creating a MockMvcBuilder with standaloneSetup there is no way to register this mapper with the builder.
I see lots of existing setup methods on StandaloneMockMvcBuilder that do similar things but none that allows for setting RequestMappingHandlerMapping. Can an equivalent method be added to the builder to allow this?
The options on StandaloneMockMvcBuilder aim to be equivalent to what is exposed through WebMvcConfigurer. The custom HandlerMapping is more of an advanced option.
That said I'll consider possible options to expose this for the standalone setup for 5.0 RC1.
Brian Johnson opened SPR-15472 and commented
I have a custom
RequestMappingHandlerMapping
class that interprets a special annotation as part of its controller method mapping criteria. This annotation is the only differentiation between multiple controller methods, and without it I get "ambiguous mapping" errors. But when creating aMockMvcBuilder
withstandaloneSetup
there is no way to register this mapper with the builder.I see lots of existing setup methods on
StandaloneMockMvcBuilder
that do similar things but none that allows for settingRequestMappingHandlerMapping
. Can an equivalent method be added to the builder to allow this?Thanks!
Referenced from: commits 191bbc2
The text was updated successfully, but these errors were encountered: