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
Dispatcher
request
. This method may block (for instance, to wait on
a CountdownLatch).dispatch
in class Dispatcher
InterruptedException
public MockResponse peek()
Dispatcher
peek
in class Dispatcher
public void enqueueResponse(MockResponse response)
public void shutdown()
Dispatcher
shutdown
in class Dispatcher
public void setFailFast(boolean failFast)
public void setFailFast(MockResponse failFastResponse)
Copyright © 2019. All rights reserved.