portletmvc4spring icon indicating copy to clipboard operation
portletmvc4spring copied to clipboard

PortletMockMvcBuilders

Open Condor70 opened this issue 4 years ago • 1 comments

Would it be possible to create a PortletMockMvcBuilders class (and supporting classes) in com.liferay.portletmvc4spring.test with similar features to MockMvcBuilders in spring-test?

There already is an old implementation for portlets, but it is for Spring 3.1.2, from the time MockMvcBuilders was not yet integrated with spring-test (4.2 and up).

Condor70 avatar Apr 28 '20 14:04 Condor70

@Condor70 That's a great feature request! The old implementation you mentioned doesn't seem to be associated with a license, so it could probably only be used as a reference.

We don't have this on the roadmap, so it would have the be a community contribution. If you would like to fork the portletmvc4spring Git repo and build out this feature, I'd be happy to review it with the intent of getting it merged into the com.liferay.portletmvc4spring.test jar. If you decide to pursue this, then I would simply ask that you depend as much as possible from the following packages:

  • org.springframework.test.web.servlet
  • org.springframework.test.web.servlet.request
  • org.springframework.test.web.servlet.result
  • org.springframework.test.web.servlet.setup

In other words, depend-on, re-use, and extend as much as possible. When classes implement or rely on HttpServletRequest, HttpServletResponse, and ServletContext, there wouldn't be much ability to re-use/extend. There would have to be portlet equivalents developed.

ngriffin7a avatar Apr 28 '20 17:04 ngriffin7a