Class RequestExpectation

java.lang.Object
com.mx.path.testing.request.RequestExpectation

public class RequestExpectation extends Object
  • Constructor Details

    • RequestExpectation

      public RequestExpectation(RequestMatcher matcher)
  • 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

      public final List<com.mx.path.core.common.connect.Request<?,?>> 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

      public final RequestExpectation times(int 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

      public final RequestExpectation collectRequests()
    • getMatcher

      public RequestMatcher getMatcher()
    • getHandler

      public BiConsumer<com.mx.path.core.common.connect.Request<?,?>,com.mx.path.core.common.connect.Response<?,?>> getHandler()
    • setInvokeCount

      public void setInvokeCount(int invokeCount)
    • getInvokeCount

      public int getInvokeCount()
    • setExpectedInvokeCount

      public void setExpectedInvokeCount(int expectedInvokeCount)
    • getExpectedInvokeCount

      public int getExpectedInvokeCount()