public class RequestResultMatchers
extends java.lang.Object
An instance of this class is typically accessed via
MockMvcResultMatchers.request()
.
Modifier | Constructor and Description |
---|---|
protected |
RequestResultMatchers()
Protected constructor.
|
Modifier and Type | Method and Description |
---|---|
private static void |
assertAsyncStarted(HttpServletRequest request) |
ResultMatcher |
asyncNotStarted()
Assert that asynchronous processing was not started.
|
<T> ResultMatcher |
asyncResult(<any> matcher)
Assert the result from asynchronous processing with the given matcher.
|
ResultMatcher |
asyncStarted()
Assert whether asynchronous processing started, usually as a result of a
controller method returning
Callable or DeferredResult . |
<T> ResultMatcher |
attribute(java.lang.String name,
<any> matcher)
Assert a request attribute value with the given Hamcrest
Matcher . |
<T> ResultMatcher |
sessionAttribute(java.lang.String name,
<any> matcher)
Assert a session attribute value with the given Hamcrest
Matcher . |
public ResultMatcher asyncStarted()
Callable
or DeferredResult
.
The test will await the completion of a Callable
so that
#asyncResult(Matcher)
can be used to assert the resulting value.
Neither a Callable
nor a DeferredResult
will complete
processing all the way since a MockHttpServletRequest
does not
perform asynchronous dispatches.
public ResultMatcher asyncNotStarted()
asyncStarted()
public <T> ResultMatcher asyncResult(<any> matcher)
This method can be used when a controller method returns Callable
or WebAsyncTask
.
public <T> ResultMatcher attribute(java.lang.String name, <any> matcher)
Matcher
.public <T> ResultMatcher sessionAttribute(java.lang.String name, <any> matcher)
Matcher
.private static void assertAsyncStarted(HttpServletRequest request)