Chris_Osthaus
17 years agoOccasional Contributor
Expecting no request in MockResponse step
I was wondering if anyone has any strategies for verifying the situation where you are expecting your MockResponse step to never receive a request.
Our web service sends out data alerts as requests to clients. In a normal case, our MockResponse step would receive the alert and perform some basic assertions on it.
We have cases where we want to verify that a client does NOT receive a request. I have tried using the "Script" portion of the MockResponse step, and examining the mockResponse object for a null value, but it looks like the "Script" only gets executed if the MockResponse step actually receives a request. I can also fail the MockResponse step by setting the "Timeout" property to an arbitrary value (the MockResponse never receives a request, so it just times out eventually). However, the test just fails out after the timeout.
Thanks to anyone who has any ideas!
Our web service sends out data alerts as requests to clients. In a normal case, our MockResponse step would receive the alert and perform some basic assertions on it.
We have cases where we want to verify that a client does NOT receive a request. I have tried using the "Script" portion of the MockResponse step, and examining the mockResponse object for a null value, but it looks like the "Script" only gets executed if the MockResponse step actually receives a request. I can also fail the MockResponse step by setting the "Timeout" property to an arbitrary value (the MockResponse never receives a request, so it just times out eventually). However, the test just fails out after the timeout.
Thanks to anyone who has any ideas!