I know that it can simulate a SocketTimeoutException with withFixedDelay , but what about a ConnectionTimeoutException ?
SocketTimeoutException
withFixedDelay
ConnectionTimeoutException
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 :
addDelayBeforeProcessingRequests(300)
http://<host>:<port>/__admin/socket-delay
{ "milliseconds": 300 }
(Obviously, replacing 300 with how many milliseconds you would like to delay)
Place an order https://github.com/tomakehurst/saboteur , which allows you to simulate network problems. Or you can do it yourself with iptables.