Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Moco: An Enterprise Integration Response/Request Testing Tool

DZone's Guide to

Moco: An Enterprise Integration Response/Request Testing Tool

· Integration Zone ·
Free Resource

SnapLogic is the leading self-service enterprise-grade integration platform. Download the 2018 GartnerMagic Quadrant for Enterprise iPaaS or play around on the platform, risk free, for 30 days.

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.

With SnapLogic’s integration platform you can save millions of dollars, increase integrator productivity by 5X, and reduce integration time to value by 90%. Sign up for our risk-free 30-day trial!

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}