Hello,
I would like to write tests for my client code, which accesses HTTP Server. I am looking for simple HTTP Server, which would simulate responses from real server.
Such HTTP Server (mock server :-)) should
- verify all requests really came from my client code
- verify that requests had all required parameters
- send response, ideally based on parameters from requests
- it should also support sending error codes, or multiple responses for multiple requests on one URI
My goal is to verify that 1) client code is working OK from server's point of view, sending all requests it should, with valid parameters, using correct method (GET/POST), and 2) client can process responses, and it can even handle some error conditions.
I am using jUnit 4 for my tests. For now, I use embedded Jetty HTTP Server as my 'mock server', but I would like to avoid writing support for above requirements. Do you know any library, which would act as http server and helping me with above-described testing?
Thank you.