java.lang.Object | |
↳ | org.springframework.test.web.ModelAndViewAssert |
A collection of assertions intended to simplify testing scenarios dealing
with Spring Web MVC ModelAndView
objects.
Intended for use with JUnit 4 and TestNG. All assert*()
methods
throw AssertionErrors.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Checks whether the model value under the given
modelName
exists and checks it type, based on the expectedType . | |||||||||||
Compare each individual entry in a list, without first sorting the lists.
| |||||||||||
Assert whether or not a model attribute is available.
| |||||||||||
Compare a given
expectedValue to the value from the model
bound under the given modelName . | |||||||||||
Inspect the
expectedModel to see if all elements in the
model appear and are equal. | |||||||||||
Compare each individual entry in a list after having sorted both lists
(optionally using a comparator).
| |||||||||||
Check to see if the view name in the ModelAndView matches the given
expectedName . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Checks whether the model value under the given modelName
exists and checks it type, based on the expectedType
. If the
model entry exists and the type matches, the model value is returned.
mav | ModelAndView to test against (never null ) |
---|---|
modelName | name of the object to add to the model (never
null ) |
expectedType | expected type of the model value |
Compare each individual entry in a list, without first sorting the lists.
mav | ModelAndView to test against (never null ) |
---|---|
modelName | name of the object to add to the model (never
null ) |
expectedList | the expected list |
Assert whether or not a model attribute is available.
mav | ModelAndView to test against (never null ) |
---|---|
modelName | name of the object to add to the model (never
null )
|
Compare a given expectedValue
to the value from the model
bound under the given modelName
.
mav | ModelAndView to test against (never null ) |
---|---|
modelName | name of the object to add to the model (never
null ) |
expectedValue | the model value |
Inspect the expectedModel
to see if all elements in the
model appear and are equal.
mav | ModelAndView to test against (never null ) |
---|---|
expectedModel | the expected model |
Compare each individual entry in a list after having sorted both lists (optionally using a comparator).
mav | ModelAndView to test against (never null ) |
---|---|
modelName | name of the object to add to the model (never
null ) |
expectedList | the expected list |
comparator | the comparator to use (may be null ). If
not specifying the comparator, both lists will be sorted not using any
comparator.
|
Check to see if the view name in the ModelAndView matches the given
expectedName
.
mav | ModelAndView to test against (never null ) |
---|---|
expectedName | the name of the model value |