testing

Testing tools, testing philosophy & methodology...
metame 2019-04-28T17:12:06.006400Z

Wanted to see if anyone had good ideas on testing a webhook service. The service POSTs to urls provided by the user. Some ideas: 1. Add a new API endpoint to our current api service that is just used for integration testing webhooks that would then write to the db or a file or something that the integration test can then fetch and read. 2. Set up a temp server that I can read responses from ideally without any fs/db side effects. Found stub-http that might support this use case(?). This would seem to preclude any remote testing (but maybe not). 1 would be simpler to implement but I don't like the idea of changing our app api for an integration test. Would think there are others who have solved this problem.

donaldball 2019-04-28T20:00:49.008500Z

I always do (2) myself. Standing up a simple jetty instance with pedestal or ring isn’t much code and there’s really no better integration test. Specifically in your case, I’d build a handler that records activity in an atom and assert the things I expected to happen actually happened.

metame 2019-04-28T20:29:04.009200Z

Thanks for the response @donaldball --- confirms what I thought I should do