Implement Random Delay (#633)

* implement random delays

* fixing CodeFactor issue

* fix code comments

* ...

* UT

Co-authored-by: Michael Yarichuk <michael.yarichuk@gmail.com>
This commit is contained in:
Stef Heyenrath
2021-09-22 13:37:41 +02:00
committed by GitHub
parent c67bf75a4b
commit ba0b9d9fd8
7 changed files with 169 additions and 11 deletions

View File

@@ -782,6 +782,10 @@ namespace WireMock.Server
{
responseBuilder = responseBuilder.WithDelay(responseModel.Delay.Value);
}
else if (responseModel.MinimumRandomDelay >= 0 || responseModel.MaximumRandomDelay > 0)
{
responseBuilder = responseBuilder.WithRandomDelay(responseModel.MinimumRandomDelay ?? 0, responseModel.MaximumRandomDelay ?? 60_000);
}
if (responseModel.UseTransformer == true)
{