Is it possible to simulate a connection timeout using wiremock connection tools?

I know that it can simulate a SocketTimeoutException with withFixedDelay , but what about a ConnectionTimeoutException ?

+8
java wiremock
source share
2 answers

Yes, this can be done using WireMock by calling addDelayBeforeProcessingRequests(300) against the Java API or by placing the following in http://<host>:<port>/__admin/socket-delay :

{ "milliseconds": 300 }

(Obviously, replacing 300 with how many milliseconds you would like to delay)

+9
source share

Place an order https://github.com/tomakehurst/saboteur , which allows you to simulate network problems. Or you can do it yourself with iptables.

+3
source share

All Articles