public abstract class AbstractRequestExpectationManager extends Object implements RequestExpectationManager
RequestExpectationManager implementations responsible
 for storing expectations and actual requests, and checking for unsatisfied
 expectations at the end.
 Subclasses are responsible for validating each request by matching it to expectations following the order of declaration or not.
| Modifier and Type | Class and Description | 
|---|---|
| protected static class  | AbstractRequestExpectationManager.RequestExpectationGroupHelper class to manage a group of remaining expectations. | 
| Constructor and Description | 
|---|
| AbstractRequestExpectationManager() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | afterExpectationsDeclared()Invoked at the time of the first actual request, which effectively means
 the expectations declaration phase is over. | 
| protected AssertionError | createUnexpectedRequestError(ClientHttpRequest request)Return an  AssertionErrorthat a subclass can raise for an
 unexpected request. | 
| ResponseActions | expectRequest(ExpectedCount count,
             RequestMatcher matcher)Set up a new request expectation. | 
| protected List<RequestExpectation> | getExpectations()Return a read-only list of the expectations. | 
| protected String | getRequestDetails()Return details of executed requests. | 
| protected List<ClientHttpRequest> | getRequests()Return a read-only list of requests executed so far. | 
| protected RequestExpectation | matchRequest(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). | 
| void | reset()Reset the internal state removing all expectations and recorded requests. | 
| ClientHttpResponse | validateRequest(ClientHttpRequest request)Validate the given actual request against the declared expectations. | 
| protected ClientHttpResponse | validateRequestInternal(ClientHttpRequest request)Deprecated. 
 as of 5.0.3, subclasses should implement  matchRequest(ClientHttpRequest)instead and return only the matched expectation, leaving the call to create the response
 as a separate step (to be invoked by this class). | 
| void | verify()Verify that all expectations have been met. | 
| void | verify(Duration timeout)Variant of  RequestExpectationManager.verify()that waits for up to the specified time for
 all expectations to be fulfilled. | 
protected List<RequestExpectation> getExpectations()
protected List<ClientHttpRequest> getRequests()
public ResponseActions expectRequest(ExpectedCount count, RequestMatcher matcher)
RequestExpectationManagerResponseActions is
 used to add more expectations and define a response.
 This is a delegate for
 MockRestServiceServer.expect(ExpectedCount, RequestMatcher).
expectRequest in interface RequestExpectationManagermatcher - a request expectationMockRestServiceServer.expect(RequestMatcher), 
MockRestServiceServer.expect(ExpectedCount, RequestMatcher)public ClientHttpResponse validateRequest(ClientHttpRequest request) throws IOException
RequestExpectationManagerThis is used in MockRestServiceServer against actual requests.
validateRequest in interface RequestExpectationManagerrequest - the requestIOException - in case of any validation errorsprotected void afterExpectationsDeclared()
@Deprecated @Nullable protected ClientHttpResponse validateRequestInternal(ClientHttpRequest request) throws IOException
matchRequest(ClientHttpRequest)
 instead and return only the matched expectation, leaving the call to create the response
 as a separate step (to be invoked by this class).IOExceptionprotected RequestExpectation matchRequest(ClientHttpRequest request) throws IOException
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).request - the current requestRequestExpectation.incrementAndValidate().IOExceptionpublic void verify()
RequestExpectationManagerThis is a delegate for MockRestServiceServer.verify().
verify in interface RequestExpectationManagerMockRestServiceServer.verify()public void verify(Duration timeout)
RequestExpectationManagerRequestExpectationManager.verify() that waits for up to the specified time for
 all expectations to be fulfilled. This can be useful for tests that
 involve asynchronous requests.verify in interface RequestExpectationManagertimeout - how long to wait for all expectations to be metprotected String getRequestDetails()
protected AssertionError createUnexpectedRequestError(ClientHttpRequest request)
AssertionError that a subclass can raise for an
 unexpected request.public void reset()
RequestExpectationManagerThis is a delegate for MockRestServiceServer.reset().
reset in interface RequestExpectationManagerMockRestServiceServer.reset()