Class MockDispatcher
- java.lang.Object
-
- io.fabric8.mockwebserver.http.Dispatcher
-
- io.fabric8.mockwebserver.internal.MockDispatcher
-
public class MockDispatcher extends Dispatcher
-
-
Constructor Summary
Constructors Constructor Description MockDispatcher(Map<ServerRequest,Queue<ServerResponse>> responses)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MockResponsedispatch(RecordedRequest request)Returns a response to satisfyrequest.voidshutdown()Release any resources held by this dispatcher.
-
-
-
Constructor Detail
-
MockDispatcher
public MockDispatcher(Map<ServerRequest,Queue<ServerResponse>> responses)
-
-
Method Detail
-
dispatch
public MockResponse dispatch(RecordedRequest request)
Description copied from class:DispatcherReturns a response to satisfyrequest. This method may block (for instance, to wait on a CountdownLatch).- Specified by:
dispatchin classDispatcher
-
shutdown
public void shutdown()
Description copied from class:DispatcherRelease any resources held by this dispatcher. Any requests that are currently being dispatched should return immediately. Responses returned after shutdown will not be transmitted: their socket connections have already been closed.- Overrides:
shutdownin classDispatcher
-
-