Announcement Announcement Module
Collapse
No announcement yet.
Testing binding errors with spring-test-mvc Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Testing binding errors with spring-test-mvc

    Hi,

    I would like to know if there is a convenient way to test Binding Errors (when validating) with spring-test-mvc.

    For example, i would like to do something like :

    standaloneSetup(resource).build()
    .perform(get("/myURL")
    .param("myFirstParam", myFirstParamWithBadValue)
    .param("mySecondParam", mySecondParamWithRigthValue)
    .andExpect(status().isInternalServerError());

    But my problem is that an Exception not handled is thrown for the perform method and i cannot go until andExpect.

    Could you help me please ?

    Thanks in advance.
Working...
X