/** * Scripts {@code response} to be returned to a request made in sequence. The * first request is served by the first enqueued response; the second request * by the second enqueued response; and so on. * * @throws ClassCastException if the default dispatcher has been replaced * with {@link #setDispatcher(Dispatcher)}. */ public void enqueue(MockResponse response) { ((QueueDispatcher) dispatcher).enqueueResponse(response.clone()); }
public void setFailFast(boolean failFast) { MockResponse failFastResponse = failFast ? new MockResponse().setResponseCode(HttpURLConnection.HTTP_NOT_FOUND) : null; setFailFast(failFastResponse); }