This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Testing and the fly likes Spring MVC 3.0 Controller Unit testing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Spring MVC 3.0 Controller Unit testing" Watch "Spring MVC 3.0 Controller Unit testing" New topic
Author

Spring MVC 3.0 Controller Unit testing

Nitesh Patel
Ranch Hand

Joined: Mar 16, 2008
Posts: 33
Hi All,
I am trying to create Junit test case for simple Spring MVC 3.0 controller. I have simple controller as below,


I am trying to create unit test for this controller as below,


But I could not find out how can I create testing object for Model. I can pass null for current test but in future I might need it (not null object). Can someone please guide me ?

Regards,
Nitesh
Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208
Hi Nitesh,

I gather from your question that you are trying to test the data in the ModelMap object that is passed as a parameter into the modelMap in the showMember method?

You can do this by creating an instance of the ModelMap class?

Niall
 
Have you checked out Aspose?
 
subject: Spring MVC 3.0 Controller Unit testing
 
It's not a secret anymore!