类 RequestResultMatchers
java.lang.Object
cn.taketoday.test.web.servlet.result.RequestResultMatchers
Factory for assertions on the request.
An instance of this class is typically accessed via
MockMvcResultMatchers.request().
- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev, Sam Brannen
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private static voidassertAsyncStarted(jakarta.servlet.http.HttpServletRequest request) Assert that asynchronous processing was not started.asyncResult(Object expectedResult) Assert the result from asynchronous processing.<T> ResultMatcherasyncResult(org.hamcrest.Matcher<? super T> matcher) Assert the result from asynchronous processing with the given matcher.Assert whether asynchronous processing started, usually as a result of a controller method returningCallableorDeferredResult.Assert a request attribute value.<T> ResultMatcherAssert a request attribute value with the given HamcrestMatcher.private static cn.taketoday.session.WebSessiongetSession(MvcResult result) Assert the given RequestContext.sessionAttribute(String name, Object value) Assert a session attribute value.<T> ResultMatchersessionAttribute(String name, org.hamcrest.Matcher<? super T> matcher) Assert a session attribute value with the given HamcrestMatcher.sessionAttributeDoesNotExist(String... names) Assert the given session attributes do not exist.
-
构造器详细资料
-
RequestResultMatchers
protected RequestResultMatchers()Protected constructor.
-
-
方法详细资料
-
asyncStarted
Assert whether asynchronous processing started, usually as a result of a controller method returningCallableorDeferredResult.The test will await the completion of a
Callableso thatasyncResult(Matcher)orasyncResult(Object)can be used to assert the resulting value.Neither a
Callablenor aDeferredResultwill complete processing all the way since aMockHttpServletRequestdoes not perform asynchronous dispatches.- 另请参阅:
-
asyncNotStarted
Assert that asynchronous processing was not started.- 另请参阅:
-
asyncResult
Assert the result from asynchronous processing with the given matcher.This method can be used when a controller method returns
CallableorWebAsyncTask. -
asyncResult
Assert the result from asynchronous processing.This method can be used when a controller method returns
CallableorWebAsyncTask. The value matched is the value returned from theCallableor the exception raised. -
attribute
Assert a request attribute value with the given HamcrestMatcher. -
attribute
Assert a request attribute value. -
sessionAttribute
Assert a session attribute value with the given HamcrestMatcher. -
getSession
-
sessionAttribute
Assert a session attribute value. -
sessionAttributeDoesNotExist
Assert the given session attributes do not exist. -
request
Assert the given RequestContext. -
assertAsyncStarted
private static void assertAsyncStarted(jakarta.servlet.http.HttpServletRequest request)
-