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 issue
I mocked a request with Times.once() but the response is returned to more than one request.
What you are trying to do
I'm trying to mock an API that works like a queue. Multiple clients are polling that API waiting for any data to unconsume.
I'm trying to use Times.once() so that only to one of the clients can get the mocked response.
Describe the issue I mocked a request with
Times.once()
but the response is returned to more than one request.What you are trying to do I'm trying to mock an API that works like a queue. Multiple clients are polling that API waiting for any data to unconsume. I'm trying to use
Times.once()
so that only to one of the clients can get the mocked response.MockServer version 5.14.0
To Reproduce A repository with minimal reproduceable. Please try a couple of times if it does not reproduce. https://github.com/maestrokame/reproduce-mockserver-issue-with-once/tree/main
How you are running MockServer (i.e maven plugin, docker, etc)
Code you used to create expectations
What error you saw No error. Just observed more than one API client getting the same response.
Expected behaviour Return the response only to one of the clients
MockServer Log log