public class SpringMatchers
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<org.springframework.ui.Model> |
containsAttribute(java.lang.String key)
Checks that a web
Model contains some
non-null value stored under a specific key. |
static <T> org.hamcrest.Matcher<org.springframework.ui.Model> |
hasAttribute(java.lang.String key,
T value)
Checks that a web
Model contains a given
key-value pair. |
static <T> org.hamcrest.Matcher<org.springframework.ui.Model> |
hasAttributeValue(java.lang.String key,
org.hamcrest.Matcher<? super T> valueMatcher)
Checks that a web
Model contains a given
key-value pair. |
static org.hamcrest.Matcher<java.lang.String> |
isRedirectedTo(java.lang.String location)
Checks that a view indicates an HTTP redirection to a given location.
|
public static <T> org.hamcrest.Matcher<org.springframework.ui.Model> hasAttribute(java.lang.String key,
T value)
Model contains a given
key-value pair.key - the key under which the value to check is stored in the model.value - the expected value stored in the model.public static <T> org.hamcrest.Matcher<org.springframework.ui.Model> hasAttributeValue(java.lang.String key,
org.hamcrest.Matcher<? super T> valueMatcher)
Model contains a given
key-value pair. The key value must match the given matcher.key - the key under which the value to check is stored in the model.valueMatcher - matcher used to check the value stored in the model.public static org.hamcrest.Matcher<org.springframework.ui.Model> containsAttribute(java.lang.String key)
Model contains some
non-null value stored under a specific key.key - the key under which a non-null value should be stored in the model.public static org.hamcrest.Matcher<java.lang.String> isRedirectedTo(java.lang.String location)
location - expected location of the redirection.