Package net.jadler.stubbing
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 ofResponseStubbing).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResponseStubbingrespond()Finishes the WHEN part of this stubbing and starts the THEN part.voidrespondUsing(Responder responder)Finishes the WHEN part of this stubbing and allows to define the THEN part in a dynamic way.-
Methods inherited from interface net.jadler.RequestMatching
havingBody, havingBodyEqualTo, havingHeader, havingHeader, havingHeaderEqualTo, havingHeaders, havingMethod, havingMethodEqualTo, havingParameter, havingParameter, havingParameterEqualTo, havingParameters, havingPath, havingPathEqualTo, havingQueryString, havingQueryStringEqualTo, havingRawBodyEqualTo, that
-
-
-
-
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-Responderinstance (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.
-
-