I am using Wiremock for stubbing the service. So that I can continue working on client application while service is down. I am recording the request and response by creating the proxy to service and using the recordings while service is down.
Their is one problem here. The api I am calling accepts xml input. One of the parameter is guid which changes every time. Now for Wiremock change in guid is another request it does another recording. Also when running playback the request does not match because of new guid in every request. Is their any way to ignore this parameter completely while doing recording and responding through playback ?
TIA
You can create an implementation of
StubMappingTransformerin Java and register it as an extension with WireMock viawireMockConfig().extensions(new MyStubMappingTransformer()when you're starting it programmatically.This will be called after a recording is completed and passed each stub that gets created, so you can add code that will e.g. swap the fields you don't want to match on exactly for placeholders.