Hey
njetty,
Asserting that a service is down is kinda complicated and asserting on it and how you assert against it all kinda depends on your architecture, setup, config and the software.
The reason why the "not contains" assertion didnt work is cos the response you got didnt include a payload.
If you think about it...it all depends on the setup of the service youre supposed to be testing, cos if it the service wasnt running, how would it be able to respond if it was down?
So essentially it depends how "offline" your endpoint is, what the setup is as well as if your devs have tailored the http responses to cover "offline" scenarios.
If your endpoint is a bit offline, then other supporting tech will help provide a response indicating it's offline....say a 5xx series http response codes. However if your endpoint and the supporting tech is down, then you wont have any response at all from the endpoint....like some socket exceptions.
Im sorry.....its not a clear answer....but it depends on the software/hardware and how "offline", "offline" actually is.
So if your endpoint is "too offline" (rubbish phrase but i dont know what else to call it), then youll never get a response to know its down. If i remember correctly a socketException is actually generated by the client not the endpoint in certain situations....so in those situations you havent got any sort of reaponse to go on. Other not so offline situations result in reaponses being returned...5xx http responses etc.
Does any of that help at all? Probably not much!
Cheers
Rich