Package org.springframework.test.web.client

# Class UnorderedRequestExpectationManager

java.lang.Object
org.springframework.test.web.client.AbstractRequestExpectationManager
org.springframework.test.web.client.UnorderedRequestExpectationManager

All Implemented Interfaces:
  `RequestExpectationManager`

public class UnorderedRequestExpectationManager extends AbstractRequestExpectationManager
`RequestExpectationManager` that matches requests to expectations regardless of the order of declaration of expected requests.

Since:
  4.3
Author:
  Rossen Stoyanchev

## Nested Class Summary

## Nested classes/interfaces inherited from class org.springframework.test.web.client.AbstractRequestExpectationManager

`AbstractRequestExpectationManager.RequestExpectationGroup`

## Constructor Summary

Constructors
Constructor
Description
`UnorderedRequestExpectationManager()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`afterExpectationsDeclared()`
Invoked at the time of the first actual request, which effectively means the expectations declaration phase is over.
`RequestExpectation`
`matchRequest(org.springframework.http.client.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.

### Methods inherited from class org.springframework.test.web.client.AbstractRequestExpectationManager

`createUnexpectedRequestError, expectRequest, getExpectations, getRequestDetails, getRequests, validateRequest, verify, verify`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### UnorderedRequestExpectationManager

public UnorderedRequestExpectationManager()

## Method Details

### afterExpectationsDeclared

protected void afterExpectationsDeclared()
Description copied from class: `AbstractRequestExpectationManager`
Invoked at the time of the first actual request, which effectively means the expectations declaration phase is over.

Overrides:
  `afterExpectationsDeclared` in class `AbstractRequestExpectationManager`

### matchRequest

public RequestExpectation matchRequest(org.springframework.http.client.ClientHttpRequest request) throws IOException
Description copied from class: `AbstractRequestExpectationManager`
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).

Overrides:
  `matchRequest` in class `AbstractRequestExpectationManager`
Parameters:
  `request` - the current request
Returns:
  the matched expectation with its request count updated via `RequestExpectation.incrementAndValidate()`.
Throws:
  `IOException`

### reset

public void reset()
Description copied from interface: `RequestExpectationManager`
Reset the internal state removing all expectations and recorded requests.

This is a delegate for `MockRestServiceServer.reset()`.

Specified by:
  `reset` in interface `RequestExpectationManager`
Overrides:
  `reset` in class `AbstractRequestExpectationManager`
See Also:
  - `MockRestServiceServer.reset()`