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

How to Transform Your Business in the Digital Age: Learn how organizations are re-architecting their integration strategy with data-driven app integration for true digital transformation.

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.

Make your mark on the industry’s leading annual report. Fill out the State of API Integration 2019 Survey and receive $25 to the Cloud Elements store.

Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}