WireMock-Net / WireMock.Net

WireMock.Net is a flexible product for stubbing and mocking web HTTP responses using advanced request matching and response templating. Based on the functionality from http://WireMock.org, but extended with more functionality.
Apache License 2.0
1.42k stars 209 forks source link

Question: Transformer and Delay in Static Mappings? #149

Closed rangerranger closed 6 years ago

rangerranger commented 6 years ago

Hi - Do you know if it is possible to add the WithTransformer and WithDelay to already recorded static mappings? Wanted to check if this was already known before running some tests. Thank you. Aroon

StefH commented 6 years ago

By static mappings, I think you mean the mappings defined in the .json file which are loaded at startup?

This is possible.

Transformation can be done like:

"UseTransformer": true,
      "StatusCode": 205,
      "BodyAsJson": { "result": "test - {{request.path}}" }

And delay is like:

"Response": {
            "StatusCode": 200,
            "Delay": 100
        }

See also this example https://github.com/WireMock-Net/WireMock.Net/wiki/Admin-API-Reference#post-__adminmappings

rangerranger commented 6 years ago

Thank you Stef.

Aroon