A lightweight Java framework for easily creating HTTP, REST, and WebSocket stub servers for integration testing.
Moco is a Java-based stub server framework that allows developers to quickly create mock HTTP, REST, and WebSocket servers for integration testing. It solves the problem of cumbersome stub server deployment by providing a lightweight, configuration-driven approach that replaces traditional WAR file setups.
Java developers and QA engineers who need to mock external HTTP services, REST APIs, or WebSocket endpoints for integration, contract, or end-to-end testing.
Developers choose Moco for its dead-simple setup, standalone runner, and flexible configuration—enabling rapid creation of stub servers without the complexity of application servers or boilerplate code.
Easy Setup Stub Server
Moco allows running a standalone server with a simple JSON configuration file, eliminating the need for complex deployment or application servers, as demonstrated in the Quick Start section with the 'java -jar' command.
It supports stubbing for HTTP, REST, WebSocket, and raw socket APIs, providing versatility for different integration testing needs, as listed in the Key Features.
Mock responses can be defined using JSON or programmatic APIs, offering both declarative and imperative approaches, which is highlighted in the Key Features and linked documentation.
If built-in features are insufficient, Moco can be extended with custom APIs, allowing developers to tailor it to specific requirements, as mentioned in the Extend Moco section of the README.
Running Moco requires a JVM, which adds overhead and complexity for teams not already using Java in their stack, as it's a Java-based framework with a standalone JAR.
Mock behaviors are primarily defined in static configuration files, making it challenging to create dynamic, stateful stubs without writing custom extensions or code, unlike more programmable alternatives.
Compared to alternatives like WireMock, Moco has a smaller community and fewer third-party integrations or tools, which might limit support for advanced features or integrations in diverse environments.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.