This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring 3 MVC jUnit testing with bindingresult

 
Praveen Kumar Singh
Ranch Hand
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a spring 3 Controller with signature


I need to write the jUnit test case for it, problem is i am struggling to get BindingResult result instance.
Is there any better way to do Spring MVC jUnit test, i was looking for mocking library, but yet not got any better answer.

Please help
 
Miku Ranjan
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have used spring but not annotation based.
Can you give some light what is BindingResult
 
Praveen Kumar Singh
Ranch Hand
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Miku,

BindingResult holds all errors detail
Flow is like, when you submit the form, you always connect it with a bean, now in sprng 3 we can actually put the annotation on beans for validation purpose
like, size of name, min and max value of int and so on
If validation failure happens, all failure information you can retrieve by BindingResult
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic