Interface RequestStubbing

  • All Superinterfaces:
    RequestMatching<RequestStubbing>
    All Known Implementing Classes:
    Stubbing

    public interface RequestStubbing
    extends RequestMatching<RequestStubbing>
    This interface defines methods for the http stubbing WHEN part. These methods provides a way to define predicates (in form of Hamcrest matchers) the incoming http request must fulfill in order to return a stub response (defined by methods of ResponseStubbing).
    • Method Detail

      • respond

        ResponseStubbing respond()
        Finishes the WHEN part of this stubbing and starts the THEN part.
        Returns:
        response stubbing instance to continue this stubbing
      • respondUsing

        void respondUsing​(Responder responder)
        Finishes the WHEN part of this stubbing and allows to define the THEN part in a dynamic way.
        Parameters:
        responder - Responder instance (usually in a form of an anonymous inner class) which dynamically creates an http response to be returned when an incoming http request matches the WHEN part.