Class SimpleRequestExpectationManager
java.lang.Object
org.springframework.test.web.client.AbstractRequestExpectationManager
org.springframework.test.web.client.SimpleRequestExpectationManager
- All Implemented Interfaces:
- RequestExpectationManager
Simple 
RequestExpectationManager that matches requests to expectations
sequentially, i.e. in the order of declaration of expectations.
When request expectations have an expected count greater than one, only the first execution is expected to match the order of declaration. Subsequent request executions may be inserted anywhere thereafter.
- Since:
- 4.3
- Author:
- Rossen Stoyanchev, Juergen Hoeller
- 
Nested Class SummaryNested classes/interfaces inherited from class AbstractRequestExpectationManagerAbstractRequestExpectationManager.RequestExpectationGroup
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidInvoked at the time of the first actual request, which effectively means the expectations declaration phase is over.protected RequestExpectationmatchRequest(ClientHttpRequest request) As of 5.0.3 subclasses should implement this method instead of#validateRequestInternal(ClientHttpRequest)in order to match the request to an expectation, leaving the call to create the response as a separate step (to be invoked by this class).voidreset()Reset the internal state removing all expectations and recorded requests.Methods inherited from class AbstractRequestExpectationManagercreateUnexpectedRequestError, expectRequest, getExpectations, getRequestDetails, getRequests, validateRequest, verify, verify
- 
Constructor Details- 
SimpleRequestExpectationManagerpublic SimpleRequestExpectationManager()
 
- 
- 
Method Details- 
afterExpectationsDeclaredprotected void afterExpectationsDeclared()Description copied from class:AbstractRequestExpectationManagerInvoked at the time of the first actual request, which effectively means the expectations declaration phase is over.- Overrides:
- afterExpectationsDeclaredin class- AbstractRequestExpectationManager
 
- 
matchRequestDescription copied from class:AbstractRequestExpectationManagerAs of 5.0.3 subclasses should implement this method instead of#validateRequestInternal(ClientHttpRequest)in order to match the request to an expectation, leaving the call to create the response as a separate step (to be invoked by this class).- Overrides:
- matchRequestin class- AbstractRequestExpectationManager
- Parameters:
- request- the current request
- Returns:
- the matched expectation with its request count updated via
RequestExpectation.incrementAndValidate().
- Throws:
- IOException
 
- 
resetpublic void reset()Description copied from interface:RequestExpectationManagerReset the internal state removing all expectations and recorded requests.This is a delegate for MockRestServiceServer.reset().- Specified by:
- resetin interface- RequestExpectationManager
- Overrides:
- resetin class- AbstractRequestExpectationManager
- See Also:
 
 
-