public class QueueDispatcher extends Dispatcher
enqueueResponse(MockResponse).| Modifier and Type | Field and Description |
|---|---|
protected BlockingQueue<MockResponse> |
responseQueue |
| Constructor and Description |
|---|
QueueDispatcher() |
| Modifier and Type | Method and Description |
|---|---|
MockResponse |
dispatch(RecordedRequest request)
Returns a response to satisfy
request. |
void |
enqueueResponse(MockResponse response) |
MockResponse |
peek()
Returns an early guess of the next response, used for policy on how an incoming request should
be received.
|
void |
setFailFast(boolean failFast) |
void |
setFailFast(MockResponse failFastResponse) |
void |
shutdown()
Release any resources held by this dispatcher.
|
protected final BlockingQueue<MockResponse> responseQueue
public MockResponse dispatch(RecordedRequest request) throws InterruptedException
Dispatcherrequest. This method may block (for instance, to wait on
a CountdownLatch).dispatch in class DispatcherInterruptedExceptionpublic MockResponse peek()
Dispatcherpeek in class Dispatcherpublic void enqueueResponse(MockResponse response)
public void shutdown()
Dispatchershutdown in class Dispatcherpublic void setFailFast(boolean failFast)
public void setFailFast(MockResponse failFastResponse)
Copyright © 2017. All Rights Reserved.