/**
* there's no built-in way to defer evaluation of a response header, hence
* this method, which allows us to send back links to the mock server.
*/
public static QueueDispatcher getURLReplacingQueueDispatcher(final URL url) {
final QueueDispatcher dispatcher = new QueueDispatcher() {
protected final BlockingQueue<MockResponse> responseQueue = new LinkedBlockingQueue<MockResponse>();
@Override
public MockResponse dispatch(RecordedRequest request) throws InterruptedException {
MockResponse response = responseQueue.take();