Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring MVC 3.0 Controller Unit testing

 
Nitesh Patel
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic