类 UnorderedRequestExpectationManager
- java.lang.Object
- org.springframework.test.web.client.AbstractRequestExpectationManager
- org.springframework.test.web.client.UnorderedRequestExpectationManager
- 所有已实现的接口:
RequestExpectationManager
public class UnorderedRequestExpectationManager extends AbstractRequestExpectationManager
RequestExpectationManager
that matches requests to expectations regardless of the order of declaration of expected requests.- 从以下版本开始:
- 4.3
- 作者:
- Rossen Stoyanchev
嵌套类概要
从类继承的嵌套类/接口 org.springframework.test.web.client.AbstractRequestExpectationManager
AbstractRequestExpectationManager.RequestExpectationGroup
构造器概要
构造器 构造器 说明 UnorderedRequestExpectationManager()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
afterExpectationsDeclared()
Invoked at the time of the first actual request, which effectively means the expectations declaration phase is over.RequestExpectation
matchRequest(ClientHttpRequest request)
As of 5.0.3 subclasses should implement this method instead ofAbstractRequestExpectationManager.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.从类继承的方法 org.springframework.test.web.client.AbstractRequestExpectationManager
createUnexpectedRequestError, expectRequest, getExpectations, getRequestDetails, getRequests, validateRequest, validateRequestInternal, verify
构造器详细资料
UnorderedRequestExpectationManager
public UnorderedRequestExpectationManager()
方法详细资料
afterExpectationsDeclared
protected void afterExpectationsDeclared()
从类复制的说明:AbstractRequestExpectationManager
Invoked at the time of the first actual request, which effectively means the expectations declaration phase is over.
matchRequest
public RequestExpectation matchRequest(ClientHttpRequest request) throws IOException
从类复制的说明:AbstractRequestExpectationManager
As of 5.0.3 subclasses should implement this method instead ofAbstractRequestExpectationManager.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).- 覆盖:
matchRequest
在类中AbstractRequestExpectationManager
- 参数:
request
- the current request- 返回:
- the matched expectation with its request count updated via
RequestExpectation.incrementAndValidate()
. - 抛出:
IOException
reset
public void reset()
从接口复制的说明:RequestExpectationManager
Reset the internal state removing all expectations and recorded requests.This is a delegate for
MockRestServiceServer.reset()
.