Sep 5th, 2012, 10:55 AM
Unit test in Spring Portlet MVC 3.1.0
I have to test the code of a huge portlet. I have never done it before and I'm just wondering if I have to test just the controllers? The portlet has a db and model packages (serveral sub-packages in both). The db package contains classes to access a MarkLogic database (a XML database). There is one main annotated controller which use another two controllers, one to save a document into database, the other one to suggest some information to the user whiles he/she is writing a document.
There are few thing that I don't really understand about the code:
Why in the main controller the author is used org.springframework.web.servlet.ModelAndView instead of org.springframework.web.portlet.ModelAndView? I think it should be the ModelAndView from the portlet package.
Why in the main controller the author is used @RequestMapping("view") instead of @RenderMapping? I think it should be @RenderMapping. Probably I am missing some points.
Few months ago I implemented some annotated Controllers and I used @RequestMapping("HelloWorld") and the string referred to a jsp. In this portlet there is not such view.jsp. It seems that the portlet mode is passed and something is happen to render the view, but not sure how. Does anyone have an idea?
Thanks a lot in advance,
Last edited by asm2545w; Sep 6th, 2012 at 03:25 AM.