public class ModelResultMatchers extends Object
MockMvcResultMatchers.model()
.Modifier | Constructor and Description |
---|---|
protected |
ModelResultMatchers()
Protected constructor.
|
Modifier and Type | Method and Description |
---|---|
<T> ResultMatcher |
attribute(String name,
org.hamcrest.Matcher<T> matcher)
Assert a model attribute value with the given Hamcrest
Matcher . |
ResultMatcher |
attribute(String name,
Object value)
Assert a model attribute value.
|
ResultMatcher |
attributeDoesNotExist(String... names)
Assert the given model attributes do not exist
|
ResultMatcher |
attributeErrorCount(String name,
int expectedCount)
Assert the given model attribute(s) have errors.
|
ResultMatcher |
attributeExists(String... names)
Assert the given model attributes exist.
|
ResultMatcher |
attributeHasErrors(String... names)
Assert the given model attribute(s) have errors.
|
ResultMatcher |
attributeHasFieldErrors(String name,
String... fieldNames)
Assert the given model attribute field(s) have errors.
|
ResultMatcher |
attributeHasNoErrors(String... names)
Assert the given model attribute(s) do not have errors.
|
<T> ResultMatcher |
errorCount(int expectedCount)
Assert the total number of errors in the model.
|
<T> ResultMatcher |
hasErrors()
Assert the model has errors.
|
<T> ResultMatcher |
hasNoErrors()
Assert the model has no errors.
|
<T> ResultMatcher |
size(int size)
Assert the number of model attributes.
|
protected ModelResultMatchers()
MockMvcResultMatchers.model()
.public <T> ResultMatcher attribute(String name, org.hamcrest.Matcher<T> matcher)
Matcher
.public ResultMatcher attribute(String name, Object value)
public ResultMatcher attributeExists(String... names)
public ResultMatcher attributeDoesNotExist(String... names)
public ResultMatcher attributeErrorCount(String name, int expectedCount)
public ResultMatcher attributeHasErrors(String... names)
public ResultMatcher attributeHasNoErrors(String... names)
public ResultMatcher attributeHasFieldErrors(String name, String... fieldNames)
public <T> ResultMatcher errorCount(int expectedCount)
public <T> ResultMatcher hasErrors()
public <T> ResultMatcher hasNoErrors()
public <T> ResultMatcher size(int size)