How can I delay a Square MockWebServer HTTP response?
There is a response.setBodyDelayTimeMs(...);
method but this is only used in SpdySocketHandler and not for HTTP requests.
That's a bug that we OkHttp maintainers need to fix. If you report it on our issue tracker, we'll tale care of it. Or better yet, send us a pull request!
response.setBodyDelay(10, TimeUnit.SECONDS)
This should now work for HTTP requests as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With