Multi-protocol remote stubbing with mountebank
mountebank is a pet project I’ve been working on for a while now to provide multi-protocol and multi-language stubbing. It does HTTP and HTTPS stubbing, but HTTP and HTTPS stubbing is a solved problem.
What mountebank does that’s really cool is stubbing and mocking for other protocols. TCP stubbing is way cool because I’m not aware of an equivalent tool currently available. We spiked this out at my current client to stub an RMI-like protocol. The test code created the Java object that it wanted the remote server to return, serialized it, and relied on mountebank to do the right thing at the right time.
It also supports SMTP, at least for mock verification. That way your app under test can connect to a real SMTP server, but that server won’t send any actual email. It will, however, allow your test to verify the data sent.
This first release of mountebank ships with:
- over the wire mock verification for http, https, tcp, and smtp
- over the wire stubbing for http, https, and tcp
- advanced stubbing predicates and multi-response stubbing for stateful services
- record and replay proxying for http, https, and tcp
heroku site: http://www.mbtest.org/