same behavior as standaloneSetup
but it would be nice to be able to do MockMvcBuilders.standaloneSetup(MyController.class)
, maybe the signature of the existing method could be changed to <? super Object>
or the like (I still get super/extends confused for generics), and Class<T>
. To be honest, off the top of my head I'm not actually certain what I'm suggesting would work for an overload. I'd be ok with a different method too. My general motivation is to have the builder, or whatever resolve the controller with DI, although maybe because it's a builder that's not possible. an alternative might be to add to @SpringJunitWebConfig( controllerClasses={ MyController.class })
and then you could not use the builder at all?
Comment From: rstoyanchev
StandaloneMockMvcBuilder
does recognize if an input "controller" Object is a Class
and if so it instantiates it accordingly. So this should work right now, have you tried? This was done defensively in case a class was passed in mistakenly but we can make it more official in the Javadoc.
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-projects-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.