Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Java
  3. Moco

Moco

MITJavav1.6.0

A lightweight Java framework for easily creating HTTP, REST, and WebSocket stub servers for integration testing.

GitHubGitHub
4.4k stars1.1k forks0 contributors

What is Moco?

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.

Target Audience

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.

Value Proposition

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.

Overview

Easy Setup Stub Server

Use Cases

Best For

  • Mocking REST APIs during frontend or mobile app development
  • Creating HTTP stubs for integration tests in CI/CD pipelines
  • Simulating third-party web service dependencies for testing
  • Testing WebSocket interactions without a live backend
  • Prototyping API responses before backend implementation
  • Running lightweight stub servers locally for development

Not Ideal For

  • Projects requiring complex, stateful mock servers with programmable logic that changes during test execution
  • Teams working primarily in non-Java ecosystems who prefer language-native mocking tools (e.g., Python's pytest-mock or Node.js's nock)
  • Scenarios demanding a graphical interface for managing and visualizing stubs without relying on configuration files
  • High-performance load testing where optimized stub servers with minimal overhead are critical

Pros & Cons

Pros

Easy Setup

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.

Multiple Protocol Support

It supports stubbing for HTTP, REST, WebSocket, and raw socket APIs, providing versatility for different integration testing needs, as listed in the Key Features.

Flexible Configuration

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.

Extensible Design

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.

Cons

Java Dependency

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.

Static Configuration Limitations

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.

Limited Tooling Ecosystem

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.

Frequently Asked Questions

Quick Stats

Stars4,431
Forks1,082
Contributors0
Open Issues139
Last commit2 days ago
CreatedSince 2012

Tags

#integration-testing#rest-api#java#websocket#mock-server#api-testing#testing-tools#http-mocking

Built With

J
Java
G
Gradle

Included in

Java47.5k
Auto-fetched 1 day ago

Related Projects

MockitoMockito

Most popular Mocking framework for unit tests written in Java

Stars15,428
Forks2,655
Last commit8 days ago
PowerMockPowerMock

PowerMock is a Java framework that allows you to unit test code normally regarded as untestable.

Stars4,184
Forks580
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub