Interface MvcTestResult
- All Superinterfaces:
- org.assertj.core.api.AssertProvider<MvcTestResultAssert>
Provides the result of an executed request using 
MockMvcTester that
 is meant to be used with assertThat.
 Can be in one of two distinct states:
- The request processed successfully, even if it failed with an exception
 that has been resolved. The result is available,
 and getUnresolvedException()will returnnull.
- The request failed unexpectedly. getUnresolvedException()provides more information about the error, and any attempt to access the result will fail with an exception.
If the request was asynchronous, it is fully resolved at this point and regular assertions can be applied without having to wait for the completion of the response.
- Since:
- 6.2
- Author:
- Stephane Nicoll, Brian Clozel
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionReturn the result of the processing.default MockHttpServletRequestReturn the performed request.default MockHttpServletResponseReturn the resulting response.Return the exception that was thrown unexpectedly while processing the request, if any.Methods inherited from interface org.assertj.core.api.AssertProviderassertThat
- 
Method Details- 
getMvcResultMvcResult getMvcResult()Return the result of the processing. If the processing has failed with an unresolved exception, the result is not available, seegetUnresolvedException().- Returns:
- the MvcResult
- Throws:
- IllegalStateException- if the processing has failed with an unresolved exception
 
- 
getRequestReturn the performed request.
- 
getResponseReturn the resulting response.
- 
getUnresolvedExceptionReturn the exception that was thrown unexpectedly while processing the request, if any.
 
-