spring-projects/spring-framework — pull request #588 by lfarmer (2014-07-08 08:27:30+00:00)
Title: Added matcher to check for specific error on a field

Added a method within the ModelResultMatcher that will
allow a user to assert whether the returned Model has an
attribute with a field that has a specific error text/ key
associated with it.

In the last project I worked on we used mockMvc extensively. In a particuar, we used mockMvc for JSR-303 validations and wanted to assert that a specific key was set as the error on a specific field. Unfortunately we could not find any matcher to help us with this, so we extended the current ModelResultMatcher, with the method present within this request.

Issue: SPR-11971

I have signed and agree to the terms of the SpringSource Individual
Contributor License Agreement.