• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring 3 MVC jUnit testing with bindingresult

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic