MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby. MockServer also includes a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding).
Describe the feature request
I'd like to request a feature to ignore certain JSON keys when using the .withBody(JsonBody.json(...)) request expectation matcher.
What you are trying to do
I have JSON bodies where the value of a particular key keeps changing with every single test run, making it impossible for me to use the .withBody() matcher.
Example
In this example, I have two JSON keys that change with each test run that I want to ignore: current-time' andrandom-id'.
Describe the feature request I'd like to request a feature to ignore certain JSON keys when using the
.withBody(JsonBody.json(...))
request expectation matcher.What you are trying to do I have JSON bodies where the value of a particular key keeps changing with every single test run, making it impossible for me to use the
.withBody()
matcher.Example In this example, I have two JSON keys that change with each test run that I want to ignore:
current-time' and
random-id'.The solution you'd like Introduce an option to specify one or more JSON keys to be ignored when matching the JSON body.
Describe alternatives you've considered I'm currently using a temporary workaround using
EasyMock.anyString()
to match any JSON body: