preloader

Developing with Testcontainers

🗓️ Last updated on February 6, 2026 | 5 | Improve this page

Overview

This guide will provide you with pointers on how to embed Microcks into your unit tests with the help of Testcontainers. The project now provides official modules for Testcontainers via a partnership with AtomicJar, the company behind this fantastic library!

You’ll learn how to automatically launch and shut down Microcks’ instances so that you can easily test your API clients and API contracts. You can find information on the official module on Testcontainers Microcks page.

As of today, we provide support for the following languages:

  • Java ☕️ - starting from Java 8 to latest releases - via a library available on Maven Central,
  • NodeJS / Typescript - via a JavaScript library with types available on NPM,
  • Golang - via a library distributed via our GitHub,
  • .NET - starting from .NET 6.0 to latest releases - via a library available on Nuget.

In addition, a community-maintained module for Python 🐍 is available — see the Community modules section below.

Let’s go 🧊

1. Java support

Our Testcontainers module for Java is io.github.microcks:microcks-testcontainers, you can easily add it to your Maven or Gradle powered project.

The library is making usage of our Uber distribution and you can simply start Microcks that way:

MicrocksContainer microcks = new MicrocksContainer(
      DockerImageName.parse("quay.io/microcks/microcks-uber:1.13.0"));
microcks.start();

See our microcks-testcontainers-java repository for full details.

Spring Boot integration

Microcks Testcontainers can be easily integrated in a Spring Boot application using Spring Boot Developer Tools so that when running in test mode, Microcks can be wired into your application to provide mocks for your dependencies.

See our demo application for Spring Boot 🍃

Quarkus integration

Microcks Testcontainers has also been extended to provide a Quarkus Dev Service. That way Microcks can be automatically started, configured and wired to your application when starting in dev:mode.

See our microcks-quarkus repository for full details as well as our demo application for Quarkus.

2. NodeJS support

Our Testcontainers module for JavaScript is @microcks/microcks-testcontainers, you can easily add it to your NPM or Yarn powered project.

The library is making usage of our Uber distribution and you can simply start Microcks that way:

const container = await new MicrocksContainer("quay.io/microcks/microcks-uber:1.13.0").start();

See our microcks-testcontainers-node repository for full details and our full demo application using NestJS

3. Golang support

Our Testcontainers module for JavaScript is github.com/testcontainers/testcontainers-go, you can easily add it to your Go mod file.

The library is making usage of our Uber distribution and you can simply start Microcks that way:

microcksContainer, err := microcks.RunContainer(ctx, testcontainers.WithImage("quay.io/microcks/microcks-uber:1.13.0"))

See our microcks-testcontainers-go repository for full details and our full demo application

4. .NET support

Our Testcontainers module for .NET is Microcks.Testcontainers, you easily add it to your .csproj file in your project.

The library is making usage of our Uber distribution and you can simply start Microcks that way:

MicrocksContainer container = new MicrocksBuilder()
	.WithImage("quay.io/microcks/microcks-uber:1.13.0")
	.Build();
await container.StartAsync();

See our microcks-testcontainers-dotnet repository for full details and our (incoming) full demo application

5. Community modules

Beyond the officially maintained modules above, the community is actively working on bindings for additional languages. These modules are not (yet) part of the official Microcks organization, but they follow the same approach and may be promoted to official modules in the future as they mature. We’re sharing them here to highlight the work and gather feedback — contributions and early adopters are very welcome! 🙌

Python support 🐍

A community-maintained Testcontainers module for Python is available as microcks_testcontainers. As it’s not yet published on PyPI, you can install it directly from GitHub:

pip install git+https://github.com/Caesarsage/microcks-testcontainers-python.git

Like the other modules, it leverages our Uber distribution and you can simply start Microcks that way:

from microcks_testcontainers import MicrocksContainer

container = MicrocksContainer("quay.io/microcks/microcks-uber:1.13.0")
container.start()

It can also be used as a context manager to automatically manage the container lifecycle:

from microcks_testcontainers import MicrocksContainer

with MicrocksContainer().with_main_artifacts(["my-api.yaml"]) as microcks:
    endpoint = microcks.get_rest_mock_endpoint("My API", "1.0")
    # Use the endpoint in your tests

Despite being a young project, this module already covers a broad feature set — REST/SOAP/GraphQL/gRPC mocking, conformance testing, secrets, OAuth2-secured endpoints and a Microcks ensemble with a Postman runtime and an Async Minion for Kafka, MQTT, AMQP, AWS SQS/SNS and Google PubSub. See the Testcontainers Modules reference for the detailed feature coverage and the microcks-testcontainers-python repository for full details, as well as a full demo application using Flask 🐍

This module is moving toward becoming an official one, and the best way to help is to give it a try, ⭐ star the repository, open issues and contribute! Feedback is highly appreciated — feel free to reach out on Discord too. 🙌

Wrap-up

Testcontainers + Microcks is a powerful combo for simplifying the write-up of robust unit or integration tests where the fixtures can be directly deduced from specifications. And the best thing is that this tooling is totally independent of your technology stack! You can use them for NodeJS, Go, Java, Ruby development, or whatever!

Check our Testcontainers Modules reference to see how the Microcks features are covered in your favourite language. We don’t provide a built-in module for the stack you’re using? Poke us on Discord, we’d really like your suggestions and help to get this rolling!

If you want to learn more about the underlying thoughts and alternatives you may have if you’re not running Testcontainers, here’s a set of blog posts written during our explorations:

Still Didn’t Find Your Answer?

Join our community and get the help you need. Engage with other members, ask questions, and share knowledge to resolve your queries and expand your understanding.

Join the community