Package com.mx.path.testing.request
Class RequestExpectation
java.lang.Object
com.mx.path.testing.request.RequestExpectation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal RequestExpectationintBiConsumer<com.mx.path.core.common.connect.Request<?,?>, com.mx.path.core.common.connect.Response<?, ?>> intfinal com.mx.path.core.common.connect.Request<?,?> Get the first request received by this expectationfinal com.mx.path.core.common.connect.Request<?,?> getReceivedRequest(RequestMatcher requestMatcher) final List<com.mx.path.core.common.connect.Request<?,?>> Get the requests received by this expectationfinal List<com.mx.path.core.common.connect.Request<?,?>> getReceivedRequests(RequestMatcher requestMatcher) Get the requests received by this expectation that match the provided request matcherfinal voidhandle(com.mx.path.core.common.connect.Request<?, ?> request, com.mx.path.core.common.connect.Response<?, ?> response) final RequestExpectationonRequest(BiConsumer<com.mx.path.core.common.connect.Request<?, ?>, com.mx.path.core.common.connect.Response<?, ?>> consumer) voidsetExpectedInvokeCount(int expectedInvokeCount) voidsetInvokeCount(int invokeCount) final RequestExpectationtimes(int times) final RequestExpectationtoRespond(BiConsumer<com.mx.path.core.common.connect.Request<?, ?>, com.mx.path.core.common.connect.Response<?, ?>> responder)
-
Constructor Details
-
RequestExpectation
-
-
Method Details
-
getReceivedRequest
public final com.mx.path.core.common.connect.Request<?,?> getReceivedRequest()Get the first request received by this expectation- Returns:
- list of requests in order they were received
-
getReceivedRequest
public final com.mx.path.core.common.connect.Request<?,?> getReceivedRequest(RequestMatcher requestMatcher) -
getReceivedRequests
Get the requests received by this expectation- Returns:
- list of requests in order they were received
-
getReceivedRequests
public final List<com.mx.path.core.common.connect.Request<?,?>> getReceivedRequests(RequestMatcher requestMatcher) Get the requests received by this expectation that match the provided request matcher- Parameters:
requestMatcher-- Returns:
- filtered list of requests in order they were received
-
handle
public final void handle(com.mx.path.core.common.connect.Request<?, ?> request, com.mx.path.core.common.connect.Response<?, ?> response) -
times
-
onRequest
public final RequestExpectation onRequest(BiConsumer<com.mx.path.core.common.connect.Request<?, ?>, com.mx.path.core.common.connect.Response<?, ?>> consumer) -
toRespond
public final RequestExpectation toRespond(BiConsumer<com.mx.path.core.common.connect.Request<?, ?>, com.mx.path.core.common.connect.Response<?, ?>> responder) -
assertInvoked
public final void assertInvoked() -
collectRequests
-
getMatcher
-
getHandler
public BiConsumer<com.mx.path.core.common.connect.Request<?,?>, getHandler()com.mx.path.core.common.connect.Response<?, ?>> -
setInvokeCount
public void setInvokeCount(int invokeCount) -
getInvokeCount
public int getInvokeCount() -
setExpectedInvokeCount
public void setExpectedInvokeCount(int expectedInvokeCount) -
getExpectedInvokeCount
public int getExpectedInvokeCount()
-