# Testcontainers

Testcontainers is an open-source library that provides throwaway, lightweight Docker-container instances of test dependencies such as databases, message brokers, and web browsers.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## API Mocking and Testing With Microcks

DevFeed: [API Mocking and Testing With Microcks](<https://devfeed.tech/articles/api-mocking-and-testing-with-microcks-4497.md>)

Original publisher: [Read original article](<https://www.baeldung.com/java-microks-api-mocking-testing>)

Author: Andrei Branza

Published: 2026-08-22T23:20:24Z

Content type: tutorial

Language: en

Sources: [Baeldung](<https://devfeed.tech/sources/baeldung.md>)

Topics: [Mocking](<https://devfeed.tech/topics/mocking.md>), [Testcontainers](<https://devfeed.tech/topics/testcontainers.md>), [API](<https://devfeed.tech/topics/api.md>), [OpenAPI Specification](<https://devfeed.tech/topics/openapi.md>), [Microservices](<https://devfeed.tech/topics/microservices.md>), [Docker Compose](<https://devfeed.tech/topics/docker-compose.md>), [Docker](<https://devfeed.tech/topics/docker.md>), [Kafka](<https://devfeed.tech/topics/kafka.md>), [Amazon Simple Queue Service (SQS)](<https://devfeed.tech/topics/amazon-simple-queue-service-sqs.md>), [GraphQL](<https://devfeed.tech/topics/graphql.md>), [gRPC](<https://devfeed.tech/topics/grpc.md>), [Jenkins](<https://devfeed.tech/topics/jenkins.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [compose](<https://devfeed.tech/tags/compose.md>), [docker](<https://devfeed.tech/tags/docker.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kafka](<https://devfeed.tech/tags/kafka.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [openapi](<https://devfeed.tech/tags/openapi.md>), [popular](<https://devfeed.tech/tags/popular.md>), [testcontainers](<https://devfeed.tech/tags/testcontainers.md>), [testing](<https://devfeed.tech/tags/testing.md>), [testing-popular-testcontainers](<https://devfeed.tech/tags/testing-popular-testcontainers.md>)

### AI overview

This tutorial explains how to use Microcks with Testcontainers to generate API mocks from contracts and run conformance tests against real implementations. It covers importing an OpenAPI contract, starting Microcks in a JUnit 5 test, calling generated mock endpoints, and integrating mocking and testing into delivery workflows.

### Source excerpt

Learn how to use Testcontainers integration to spin up Microcks inside a JUnit5 test. The post API Mocking and Testing With Microcks first appeared on Baeldung.

## Scaling out Distroless adoption With AI

DevFeed: [Scaling out Distroless adoption With AI](<https://devfeed.tech/articles/scaling-out-distroless-adoption-with-ai-1254.md>)

Original publisher: [Read original article](<https://engineering.grab.com/scaling-out-distroless-adoption-with-ai>)

Author: Jia Yee Chong

Published: 2026-06-22T00:00:00Z

Content type: article

Language: en

Sources: [Grab Tech](<https://devfeed.tech/sources/grab-tech.md>)

Topics: [Security](<https://devfeed.tech/topics/security.md>), [migration](<https://devfeed.tech/topics/migration.md>), [Dockerfile](<https://devfeed.tech/topics/dockerfile.md>), [Vulnerabilities](<https://devfeed.tech/topics/vulnerabilities.md>), [make](<https://devfeed.tech/topics/make.md>), [ci](<https://devfeed.tech/topics/ci.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Docker](<https://devfeed.tech/topics/docker.md>), [Docker Image](<https://devfeed.tech/topics/docker-image.md>), [Testcontainers](<https://devfeed.tech/topics/testcontainers.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>)

Tags: [artificial-intelligence](<https://devfeed.tech/tags/artificial-intelligence.md>), [ci](<https://devfeed.tech/tags/ci.md>), [containers](<https://devfeed.tech/tags/containers.md>), [devsecops](<https://devfeed.tech/tags/devsecops.md>), [docker](<https://devfeed.tech/tags/docker.md>), [docker-image](<https://devfeed.tech/tags/docker-image.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [migration](<https://devfeed.tech/tags/migration.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [security](<https://devfeed.tech/tags/security.md>), [testcontainers](<https://devfeed.tech/tags/testcontainers.md>), [testing](<https://devfeed.tech/tags/testing.md>), [vulnerabilities](<https://devfeed.tech/tags/vulnerabilities.md>)

### AI overview

Grab describes migrating services from heavy base images to Distroless images to reduce security risks and eliminate unnecessary binaries and associated CVEs. The article explains the runtime-failure risks of this migration and presents medium tests using Docker images, Testcontainers, and network proxies to verify configuration and runtime dependencies in CI.

### Source excerpt

Distroless adoption at Grab Grab is migrating from heavy base images to Distroless images to reduce security risks. By limiting each container to the application and its runtime dependencies, we shed non-essential binaries and associated Common Vulnerabilities and Exposures (CVEs). This migration is more than a compliance mandate; it is a strategic security decision to build a more resilient environment. Why Distroless requires rigorous testing Distroless adoption risk: Runtime failure Shifting to Distroless images introduces a critical technical risk: Runtime Failure. A service might build perfectly in Continuous Integration (CI), but fail at the deployment stage due to: Missing shared objects: Binaries might require specific libraries (.so files) present in Ubuntu but absent in Distroless. Implicit links: Third-party tools might expect specific system utilities or directory structures. Testing is required to ensure two things: The service spins up with the correct configuration. All runtime dependencies remain intact. Scaling this verification across thousands of services manually? That would take years, unless we found a way to automate the trust. The testing methodology As we perform changes to the Dockerfile definition of our services, it is important for us to include the corresponding test strategy to ensure that the changes that we make do not introduce a regression to our running services. Assessing the change introduced to our services, the lowest possible testing boundary would be that of what we define as medium tests in Grab. Medium tests in Grab At Grab, we categorize our test suites into 3 main sizes: small, medium and large. Small tests refer to functional tests whereby mocks are introduced via dependency injection. Large tests refer to end-to-end tests that run on actual services in our staging environment where nothing is mocked. Figure 1: Architecture diagram of a medium test environment Medium tests sit between the small and large tests. External

## Catch Bugs Early with Testcontainers: Shift-Left Testing Made Easy

DevFeed: [Catch Bugs Early with Testcontainers: Shift-Left Testing Made Easy](<https://devfeed.tech/articles/catch-bugs-early-with-testcontainers-shift-left-testing-made-easy-6.md>)

Original publisher: [Read original article](<https://blog.abhimanyu-saharan.com/posts/catch-bugs-early-with-testcontainers-shift-left-testing-made-easy>)

Author: Abhimanyu Saharan

Published: 2025-05-15T00:00:00Z

Content type: article

Language: en

Sources: [Abhimanyu Saharan](<https://devfeed.tech/sources/abhimanyu-s-blog.md>)

Topics: [Testcontainers](<https://devfeed.tech/topics/testcontainers.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [bugs](<https://devfeed.tech/tags/bugs.md>), [code](<https://devfeed.tech/tags/code.md>), [docker](<https://devfeed.tech/tags/docker.md>), [integration](<https://devfeed.tech/tags/integration.md>), [shift-left](<https://devfeed.tech/tags/shift-left.md>), [speed](<https://devfeed.tech/tags/speed.md>), [testcontainers](<https://devfeed.tech/tags/testcontainers.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

The article explains how Testcontainers can run integration tests with real services to catch bugs earlier and improve software reliability, speed, and confidence.

### Source excerpt

Catch bugs early by running integration tests with real services using Testcontainers, improving reliability, speed, and confidence in your code.

## When to Use jOOQ and When to Use Native SQL

DevFeed: [When to Use jOOQ and When to Use Native SQL](<https://devfeed.tech/articles/when-to-use-jooq-and-when-to-use-native-sql-28972.md>)

Original publisher: [Read original article](<https://blog.jooq.org/when-to-use-jooq-and-when-to-use-native-sql/>)

Author: lukaseder

Published: 2022-12-08T13:53:02Z

Content type: comparison

Language: en

Sources: [jOOQ](<https://devfeed.tech/sources/jooq.md>)

Topics: [SQL](<https://devfeed.tech/topics/sql.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [rdbms](<https://devfeed.tech/topics/rdbms.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Testcontainers](<https://devfeed.tech/topics/testcontainers.md>)

Tags: [cons](<https://devfeed.tech/tags/cons.md>), [examples](<https://devfeed.tech/tags/examples.md>), [jdbc](<https://devfeed.tech/tags/jdbc.md>), [jdbctemplate](<https://devfeed.tech/tags/jdbctemplate.md>), [jdbi](<https://devfeed.tech/tags/jdbi.md>), [jooq](<https://devfeed.tech/tags/jooq.md>), [jooq-in-use](<https://devfeed.tech/tags/jooq-in-use.md>), [native-sql](<https://devfeed.tech/tags/native-sql.md>), [plain-jdbc](<https://devfeed.tech/tags/plain-jdbc.md>), [plain-sql-templating](<https://devfeed.tech/tags/plain-sql-templating.md>), [rdbms](<https://devfeed.tech/tags/rdbms.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sql-json](<https://devfeed.tech/tags/sql-json.md>), [stored-procedures](<https://devfeed.tech/tags/stored-procedures.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [testcontainers](<https://devfeed.tech/tags/testcontainers.md>)

### AI overview

This comparison explains when to use the jOOQ API and when to use native SQL for complex queries. It describes jOOQ's advantages for dynamic SQL, multiple database dialects, type safety, data mapping, stored procedures, security, exports, and diagnostics, while noting usability drawbacks for large static queries with many CTEs or derived tables.

### Source excerpt

A frequently encountered doubt people have when using jOOQ is to decide when a "complex" query should be written using jOOQ API vs. when it should be implemented using native SQL. The jOOQ manual is full of side by side examples of the same query, e.g. Using jOOQ: Using native SQL: In the native SQL ... Continue reading When to Use jOOQ and When to Use Native SQL ->

## How to setup remote docker host

DevFeed: [How to setup remote docker host](<https://devfeed.tech/articles/how-to-setup-remote-docker-host-27332.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/202209/remote-docker/>)

Published: 2022-09-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [Docker](<https://devfeed.tech/topics/docker.md>), [Image](<https://devfeed.tech/topics/image.md>), [docker images](<https://devfeed.tech/topics/docker-images.md>), [Testcontainers](<https://devfeed.tech/topics/testcontainers.md>), [Amazon EC2](<https://devfeed.tech/topics/amazon-ec2.md>), [Amazon Web Services](<https://devfeed.tech/topics/aws.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [TLS (Transport Layer Security)](<https://devfeed.tech/topics/tls.md>), [x86](<https://devfeed.tech/topics/x86.md>)

Tags: [arm](<https://devfeed.tech/tags/arm.md>), [aws](<https://devfeed.tech/tags/aws.md>), [containers](<https://devfeed.tech/tags/containers.md>), [docker](<https://devfeed.tech/tags/docker.md>), [docker-images](<https://devfeed.tech/tags/docker-images.md>), [ec2](<https://devfeed.tech/tags/ec2.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [integration-test](<https://devfeed.tech/tags/integration-test.md>), [linux](<https://devfeed.tech/tags/linux.md>), [remote](<https://devfeed.tech/tags/remote.md>), [tls](<https://devfeed.tech/tags/tls.md>), [x86](<https://devfeed.tech/tags/x86.md>)

### AI overview

This tutorial explains how to set up a remote Docker host for integration tests when required ARM images are unavailable. It uses a Linux x86_64 AWS EC2 machine, configures TLS access to the Docker daemon, and connects a local Docker client to the remote host.

### Source excerpt

Not all docker images are available for ARM architecture (hopefully this will improve over time). Right now I'm working on a project where images for ARM are not available. Emulation works ok (but slow) most of the time. Lately, I stumbled upon an interesting performance/startup issue when running amd64-based containers using testcontainers in an integration test. Read more

## How to Integration Test Stored Procedures with jOOQ

DevFeed: [How to Integration Test Stored Procedures with jOOQ](<https://devfeed.tech/articles/how-to-integration-test-stored-procedures-with-jooq-28942.md>)

Original publisher: [Read original article](<https://blog.jooq.org/how-to-integration-test-stored-procedures-with-jooq/>)

Author: lukaseder

Published: 2022-08-22T12:36:00Z

Content type: tutorial

Language: en

Sources: [jOOQ](<https://devfeed.tech/sources/jooq.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Database](<https://devfeed.tech/topics/database.md>), [Testcontainers](<https://devfeed.tech/topics/testcontainers.md>), [Java](<https://devfeed.tech/topics/java.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [database](<https://devfeed.tech/tags/database.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [integration-test](<https://devfeed.tech/tags/integration-test.md>), [integration-testing](<https://devfeed.tech/tags/integration-testing.md>), [java](<https://devfeed.tech/tags/java.md>), [jooq](<https://devfeed.tech/tags/jooq.md>), [jooq-in-use](<https://devfeed.tech/tags/jooq-in-use.md>), [junit](<https://devfeed.tech/tags/junit.md>), [maven](<https://devfeed.tech/tags/maven.md>), [stored-procedures](<https://devfeed.tech/tags/stored-procedures.md>), [testcontainers](<https://devfeed.tech/tags/testcontainers.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

### AI overview

This tutorial explains how to integration-test database stored procedures and functions with Java, jOOQ, Testcontainers, and JUnit. It shows how to run PostgreSQL in Testcontainers, generate jOOQ classes for stored procedures, and reuse Java test infrastructure instead of manually binding to procedures through JDBC.

### Source excerpt

When you write stored procedures and functions in your database, you want to ensure their correctness, just like with your Java code. In Java, this is done with unit tests, typically with JUnit. For example, if you have the following code in Java: Then, you might write a test like this: But how do we ... Continue reading How to Integration Test Stored Procedures with jOOQ ->

## Fast and Stable MongoDB-Based Tests in Spring

DevFeed: [Fast and Stable MongoDB-Based Tests in Spring](<https://devfeed.tech/articles/fast-and-stable-mongodb-based-tests-in-spring-17701.md>)

Original publisher: [Read original article](<https://nexocode.com/blog/posts/fast-stable-mongodb-tests-spring/>)

Author: piotr-kubowicz

Published: 2020-12-07T00:00:00Z

Content type: tutorial

Language: en

Sources: [Backend Development on nexocode](<https://devfeed.tech/sources/backend-development-on-nexocode.md>)

Topics: [MongoDB](<https://devfeed.tech/topics/mongodb.md>), [Testcontainers](<https://devfeed.tech/topics/testcontainers.md>), [Spring Boot](<https://devfeed.tech/topics/spring-boot.md>), [Database](<https://devfeed.tech/topics/database.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>)

Tags: [database](<https://devfeed.tech/tags/database.md>), [embedded](<https://devfeed.tech/tags/embedded.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [linux](<https://devfeed.tech/tags/linux.md>), [mongodb](<https://devfeed.tech/tags/mongodb.md>), [performance](<https://devfeed.tech/tags/performance.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>), [spring](<https://devfeed.tech/tags/spring.md>), [testcontainers](<https://devfeed.tech/tags/testcontainers.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [tutorials](<https://devfeed.tech/tags/tutorials.md>)

### AI overview

A tutorial for replacing Flapdoodle Embedded Mongo with Testcontainers in Spring applications. It explains problems caused by multiple embedded MongoDB instances, shows how to set up MongoDB with Testcontainers, and discusses performance measurement using Linux tools.

### Source excerpt

If your Spring application uses MongoDB, there is one question you will have to answer at some point: how to set up a database instance for your tests. Until early 2020 there was not much choice and the default was to use 'embedded Mongo' - my team was no exception. At some point, however, we realised that embedded Mongo was turning our builds into a nightmare. This ultimately prompted us to migrate our code to a tool getting much hype recently - Testcontainers.

## Quarkus and Testcontainers

DevFeed: [Quarkus and Testcontainers](<https://devfeed.tech/articles/quarkus-and-testcontainers-18860.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/quarkus-and-testcontainers/>)

Published: 2020-11-28T16:45:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Quarkus](<https://devfeed.tech/topics/quarkus.md>), [Testcontainers](<https://devfeed.tech/topics/testcontainers.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [Docker](<https://devfeed.tech/topics/docker.md>), [Object-relational mapping](<https://devfeed.tech/topics/orm.md>), [SQL](<https://devfeed.tech/topics/sql.md>)

Tags: [databases](<https://devfeed.tech/tags/databases.md>), [docker](<https://devfeed.tech/tags/docker.md>), [kafka](<https://devfeed.tech/tags/kafka.md>), [orm](<https://devfeed.tech/tags/orm.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [quarkus](<https://devfeed.tech/tags/quarkus.md>), [schema](<https://devfeed.tech/tags/schema.md>), [sql](<https://devfeed.tech/tags/sql.md>), [testcontainers](<https://devfeed.tech/tags/testcontainers.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>)

### AI overview

A tutorial on integrating Quarkus test resources with Testcontainers for JUnit tests. It explains the limitations of combining the Quarkus and Testcontainers JUnit extensions, recommends dynamically assigned Docker ports, and presents Quarkus test resources as an alternative for managing container lifecycles and database setup.

### Source excerpt

Table of Contents Bonus: Schema Creation The Testcontainers project is invaluable for spinning up containerized resources during your (JUnit) tests, e.g. databases or Kafka clusters. For users of JUnit 5, the project provides the @Testcontainers extension, which controls the lifecycle of containers used by a test. When testing a Quarkus application though, this is at odds with Quarkus' own @QuarkusTest extension; it's a recommended best practice to avoid fixed ports for any containers started by Testcontainers. Instead, you should rely on Docker to automatically allocate random free ports. This avoids conflicts between concurrently running tests, e.g. amongst multiple Postgres containers, started up by several parallel job runs in a CI environment, all trying to allocate Postgres' default port 5432. Obtaining the randomly assigned port and passing it into the Quarkus bootstrap process isn't possible though when combining the two JUnit extensions.

## Testcontainers

DevFeed: [Testcontainers](<https://devfeed.tech/articles/testcontainers-27310.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/201907/testcontainers/>)

Published: 2019-07-18T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [Testcontainers](<https://devfeed.tech/topics/testcontainers.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Docker](<https://devfeed.tech/topics/docker.md>), [Redis](<https://devfeed.tech/topics/redis.md>)

Tags: [docker](<https://devfeed.tech/tags/docker.md>), [integration](<https://devfeed.tech/tags/integration.md>), [redis](<https://devfeed.tech/tags/redis.md>), [services](<https://devfeed.tech/tags/services.md>), [testcontainers](<https://devfeed.tech/tags/testcontainers.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

A tutorial on using Testcontainers to run Docker containers for integration tests. It demonstrates testing communication with a live Redis instance without manually preparing infrastructure.

### Source excerpt

Recently I've found a very interesting project which allows to spin up docker containers for test purposes. Writing tests checking integration with external services is not an easy task. With testcontainers library it gets simpler because you can have external service up and running just for your test in a couple of lines of code. Read more