mock-server / mockserver

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).
http://mock-server.com
Apache License 2.0
4.57k stars 1.07k forks source link

Verify no interactions with mock server #171

Closed Unisay closed 8 years ago

Unisay commented 9 years ago

For the negative test case I need to verify there were no interactions with the mock server. Analog of Mockito.verifyZeroInteractions()

Currently I can only verify interactions for some HttpRequest[s]. Is it possible to do something like MockServerClient.verify(request(), VerificationTimes.exactly(0)) ?

jamesdbloom commented 8 years ago

It should be possible to do

MockServerClient.verify(request(), VerificationTimes.exactly(0))

I have added an extra test to cover that scenario however the test passed as soon as I added it.

This will ensure that a request that matches all requests has been seen exactly zero times. I have also added a syntactic sugar method to the client that underneath does the same thing:

MockServerClient.verifyZeroInteractions()
jamesdbloom commented 8 years ago

I'm going to close this ticket