open class ModelResultMatchers
Factory for assertions on the model.
An instance of this class is typically accessed via MockMvcResultMatchers#model.
Author
Rossen Stoyanchev
Since
3.2
open fun <T : Any> attribute(name: String, matcher: Matcher<T>): ResultMatcher
Assert a model attribute value with the given Hamcrest Matcher. open fun attribute(name: String, value: Any): ResultMatcher
Assert a model attribute value. |
|
open fun attributeDoesNotExist(vararg names: String): ResultMatcher
Assert the given model attributes do not exist |
|
open fun attributeErrorCount(name: String, expectedCount: Int): ResultMatcher
Assert the given model attribute(s) have errors. |
|
open fun attributeExists(vararg names: String): ResultMatcher
Assert the given model attributes exist. |
|
open fun attributeHasErrors(vararg names: String): ResultMatcher
Assert the given model attribute(s) have errors. |
|
open fun attributeHasFieldErrorCode(name: String, fieldName: String, error: String): ResultMatcher
Assert a field error code for a model attribute using exact String match. open fun <T : Any> attributeHasFieldErrorCode(name: String, fieldName: String, matcher: Matcher<in String>): ResultMatcher
Assert a field error code for a model attribute using a org.hamcrest.Matcher. |
|
open fun attributeHasFieldErrors(name: String, vararg fieldNames: String): ResultMatcher
Assert the given model attribute field(s) have errors. |
|
open fun attributeHasNoErrors(vararg names: String): ResultMatcher
Assert the given model attribute(s) do not have errors. |
|
open fun <T : Any> errorCount(expectedCount: Int): ResultMatcher
Assert the total number of errors in the model. |
|
open fun <T : Any> hasErrors(): ResultMatcher
Assert the model has errors. |
|
open fun <T : Any> hasNoErrors(): ResultMatcher
Assert the model has no errors. |
|
open fun <T : Any> size(size: Int): ResultMatcher
Assert the number of model attributes. |