A frequent need when working with networking based applications is that we have to test both the server and client. If we are writing a distributed application, we are probably going to write both the client and the server ourselves, and that means we'll want to test both of them just as we did with our Chat application in previous chapters.
While we might want to have a limited number of tests that connect to a real running server, that quickly becomes too expensive if we involve real networking, and could also result in errors related to the maximum amount of open connections our system can handle, along with the time it takes to actually shut down those connections.
So we need to be able to test the client side of the application without having to connect to a real server for the majority of our tests, or our test suite will quickly become unmaintainable.
Let's suppose we are writing a very simple httpclient command-line application that will allow us to request...