Documentation suggests testing API client based on WSClient using a mock web service, that is, create a play.server.Server
which will respond to real HTTP requests.
I would prefer to create WSResponse
objects directly from files, complete with status line, header lines and body, without real TCP connections. That would require less dependencies and run faster. Also there may be other cases when this is useful.
But I can't find a simple way to do it. It seems all implementations wrapped by WSResponse
are tied to reading from network.
Should I just create my own subclass of WSResponse for this, or maybe I'm wrong and it already exists?