Enterprise Integration Zone is brought to you in partnership with:

Mitch Pronschinske is the Lead Research Analyst at DZone. Researching and compiling content for DZone's research guides is his primary job. He likes to make his own ringtones, watches cartoons/anime, enjoys card and board games, and plays the accordion. Mitch is a DZone Zone Leader and has posted 2576 posts at DZone. You can read more from them at their website. View Full User Profile

Moco: An Enterprise Integration Response/Request Testing Tool

07.11.2013
| 6058 views |
  • submit to reddit

Integrating test cases along with your applications can wreak havoc on the build process.  A different approach is usually required for testing integration points on your enterprise applications and today I came across a nifty open source tool that can possibly help alleviate some of that difficulty.

Moco, an open source tool created by Zheng Ye, is an "Easy Setup Stub Server" for testing network endpoints.  Essentially, all you need to write are two lines of code and you'll have your own HTTP server set up for simple request/response testing:

MocoHttpServer server = httpserver(50404);
server.response("howdy");


Pretty neat.  There's a lot more to it than just this.  You'll want to glance at these docs before you start using it so that you know its exact limitations:


Zheng says he was influenced by Mocketo and the Play! framework.  As for why he made it, I'll let him answer that:

Integration, especially based on HTTP protocol, e.g. web service, REST etc, is wildly used in most of our development.

In the old days, we just deployed another WAR to an application server, e.g. Jetty or Tomcat etc. As we all know, it's so boring to develop a WAR and deploy it to any application server, even if we use an embedded server. And the WAR needs to be reassembled even if we just want to change a little bit.

Give it a test drive or consider contributing to the project.