Search code examples
wiremockwiremock-record

Wiremock Snapshotting with simulated delay


Wiremock version: 2.27.0

Using Wiremock to run load testing, with the following workflow.

a. Proxy enabled and a single run of Load testing is executed (warm-up phase).

b. Generate SnapShot

c. Then modify the mapping (getting/setting via REST API), and decorate it with delayDistribution

d. Run Subsequent Load test runs (the actual runs, that contribute to final stats)

Is there a better way to do this? For instance, is there a way to decorate existing mapping with DelayCharacteristics. I looked into the extensions, but could not find a more elegant method.


Solution

  • To my knowledge there is no read-made solution for you to download and implement. However, it is possible for you to develop yourself.

    In the WireMock documentation on Record and Playback the section on Transforming generated stubs by creating an extension based on StubMappingTransformer.

    There is also some documentation to be found here in the example.