A gor middleware app that allows you to verify if your acc server is sending (more or less) the same responses as your prod server.
(last tested with gor 1.0.0)
Build it with
mvn package
Run it with
gor --input-raw <your-prod-server> --output-http=<your-staging-server> --middleware "./target/appassembler/bin/gor-tester default_config.yml" --input-raw-track-response
gor will send each request that was sent to the production server to your staging server. This middleware will compare the response from the acceptation server to that of the production server.
The middleware allows you to write rules that
- prevent certain requests from being replicated to the auth server
- modify the replay request. To replace auth headers for example.
- modify the original or replay response.
The middleware also allows you to write rules that
- Check if the replayed response contains all the headers of the original response and possibly more
- Check if the status codes match
- Check if the bodies are exactly equal
Gor sends the requests and responses in an undefined order to the middleware, but your rule's methods will always be called with the data you need (the middleware stores data if needed and waits for the rest to arrive).
A few rules are provided. You configure them in a yaml file. There is a good chance that the provided rules are not enough and you'll have to add some rules of yourself.
Pull requests welcome :)