Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support RequestMappingHandlerMapping registrations in the StandaloneMockMvcBuilder setup [SPR-15472] #20032

Closed
spring-projects-issues opened this issue Apr 21, 2017 · 1 comment
Assignees
Labels
in: test type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Apr 21, 2017

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 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?

Thanks!


Referenced from: commits 191bbc2

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Apr 25, 2017

Rossen Stoyanchev commented

Similar request here http://stackoverflow.com/questions/43102003/custom-requestmappinghandlermapping-with-mockmvc.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants