aspose file tools*
The moose likes Spring and the fly likes Spring 3 MVC jUnit testing with bindingresult Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring 3 MVC jUnit testing with bindingresult" Watch "Spring 3 MVC jUnit testing with bindingresult" New topic
Author

Spring 3 MVC jUnit testing with bindingresult

Praveen Kumar Singh
Ranch Hand

Joined: Mar 04, 2009
Posts: 43
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


Praveen
SCJP, SCWCD, SOA
Miku Ranjan
Ranch Hand

Joined: Oct 11, 2011
Posts: 98
Hi,
I have used spring but not annotation based.
Can you give some light what is BindingResult
Praveen Kumar Singh
Ranch Hand

Joined: Mar 04, 2009
Posts: 43
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring 3 MVC jUnit testing with bindingresult