# Testcontainers

Published articles for Testcontainers.

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.

## Running AI agents in GitHub Actions with Docker Sandboxes

DevFeed: [Running AI agents in GitHub Actions with Docker Sandboxes](<https://devfeed.tech/articles/running-ai-agents-in-github-actions-with-docker-sandboxes-4591.md>)

Original publisher: [Read original article](<https://www.docker.com/blog/running-ai-agents-in-github-actions-with-docker-sandboxes/>)

Author: Jennifer Kohl

Published: 2026-08-21T13:00:00Z

Content type: tutorial

Language: en

Sources: [Docker](<https://devfeed.tech/sources/docker.md>)

Topics: [AI-assisted coding](<https://devfeed.tech/topics/ai-assisted-coding.md>), [ci](<https://devfeed.tech/topics/ci.md>)

Tags: [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [ai-coding](<https://devfeed.tech/tags/ai-coding.md>), [ci](<https://devfeed.tech/tags/ci.md>), [docker](<https://devfeed.tech/tags/docker.md>), [docker-sandboxes](<https://devfeed.tech/tags/docker-sandboxes.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [github-actions](<https://devfeed.tech/tags/github-actions.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [pull-requests](<https://devfeed.tech/tags/pull-requests.md>), [sandboxes](<https://devfeed.tech/tags/sandboxes.md>), [testcontainers](<https://devfeed.tech/tags/testcontainers.md>)

### AI overview

A tutorial on running AI coding agents in GitHub Actions inside Docker Sandboxes, emphasizing isolated execution while agents run tests, fix a seeded bug, and open a draft pull request.

### Source excerpt

Run AI agents in GitHub Actions with Docker Sandboxes. See how isolated agents can run Testcontainers tests, fix code, and open draft pull requests.

## 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.

## Keycloak DevDay 2024 Videos published

DevFeed: [Keycloak DevDay 2024 Videos published](<https://devfeed.tech/articles/keycloak-devday-2024-videos-published-31646.md>)

Original publisher: [Read original article](<https://www.keycloak.org/2024/06/keycloak-dev-day-videos>)

Author: Niko Köbler

Published: 2024-06-14T00:00:00Z

Content type: release

Language: en

Sources: [Keycloak Blog](<https://devfeed.tech/sources/keycloak-blog.md>)

Topics: [Keycloak](<https://devfeed.tech/topics/keycloak.md>), [IAM](<https://devfeed.tech/topics/iam.md>), [Multi-tenancy](<https://devfeed.tech/topics/multi-tenancy.md>), [opa](<https://devfeed.tech/topics/opa.md>), [Apache Cassandra](<https://devfeed.tech/topics/cassandra.md>), [Extension](<https://devfeed.tech/topics/extension.md>), [Testcontainers](<https://devfeed.tech/topics/testcontainers.md>)

Tags: [cassandra](<https://devfeed.tech/tags/cassandra.md>), [community](<https://devfeed.tech/tags/community.md>), [conference](<https://devfeed.tech/tags/conference.md>), [event](<https://devfeed.tech/tags/event.md>), [extension](<https://devfeed.tech/tags/extension.md>), [idm](<https://devfeed.tech/tags/idm.md>), [kerberos](<https://devfeed.tech/tags/kerberos.md>), [keycloak](<https://devfeed.tech/tags/keycloak.md>), [ldap](<https://devfeed.tech/tags/ldap.md>), [multi-tenancy](<https://devfeed.tech/tags/multi-tenancy.md>), [opa](<https://devfeed.tech/tags/opa.md>), [openid-connect](<https://devfeed.tech/tags/openid-connect.md>), [saml](<https://devfeed.tech/tags/saml.md>), [sso](<https://devfeed.tech/tags/sso.md>), [testcontainers](<https://devfeed.tech/tags/testcontainers.md>), [videos](<https://devfeed.tech/tags/videos.md>)

### AI overview

This announcement says that recorded and live-streamed sessions from the first Keycloak DevDay conference were published online. It lists sessions covering Keycloak, including multi-tenancy, access management with OPA, extension development, Testcontainers, IAM, configuration, and Cassandra.

### Source excerpt

Back in February this year, we (Sebastian and me (Niko)) hosted the very first edition of Keycloak DevDay - a one-day, community-driven conference - in Frankfurt/Main, Germany. The event was a blast and completely sold-out, plus many additional participants online in the two parallel live streams. We were able to welcome attendees from all over Europe. Thank you all for being part of this incredible event! 🙏 For all of you who couldn't attend, we have published all the recorded and live streamed sessions online on my YouTube channel: Keynote: What's Next in Keycloak (Alexander Schwartz, Red Hat) Multi-Tenancy in Keycloak (Garth Patil, Phase Two) Flexible Access Management with Keycloak & OPA (Thomas Darimont, codecentric) Best Practices for Extension Development (Sven-Torben Janus, Conciso) Extensions Development with Testcontainers (Niko Köbler, @dasniko) A Look at Keycloak from the IAM Point of View (Robert Bauer, intension) Automating Keycloak Configuration (Sophie Tauchert, Relaxdays) Ask the Maintainers Session (A. Schwartz, T. Darimont, S. Schuster) IAM Doomsday Prepper (Maik Kingma) Keycloak Cassandra Datastore (Dominik Schlosser) The complete playlist can be found here. We are currently preparing the next edition "Keycloak DeveloperDay 2025". If you want to contribute, please get in touch with us (Sebastian & Niko)! Expect more information in the next weeks and months. Looking forward to have you and your colleagues & team members as attendees!

## 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 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 ->

## Using H2 as a Test Database Product with jOOQ

DevFeed: [Using H2 as a Test Database Product with jOOQ](<https://devfeed.tech/articles/using-h2-as-a-test-database-product-with-jooq-28969.md>)

Original publisher: [Read original article](<https://blog.jooq.org/using-h2-as-a-test-database-product/>)

Author: lukaseder

Published: 2022-08-19T07:25:43Z

Content type: tutorial

Language: en

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

Topics: [in-memory database](<https://devfeed.tech/topics/in-memory-database.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Java](<https://devfeed.tech/topics/java.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [sql-server](<https://devfeed.tech/topics/sql-server.md>)

Tags: [compatibility-mode](<https://devfeed.tech/tags/compatibility-mode.md>), [database](<https://devfeed.tech/tags/database.md>), [h2](<https://devfeed.tech/tags/h2.md>), [in-memory-database](<https://devfeed.tech/tags/in-memory-database.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>), [sql](<https://devfeed.tech/tags/sql.md>), [sql-server](<https://devfeed.tech/tags/sql-server.md>), [testcontainers](<https://devfeed.tech/tags/testcontainers.md>), [testing](<https://devfeed.tech/tags/testing.md>), [vendor-agnosticity](<https://devfeed.tech/tags/vendor-agnosticity.md>)

### AI overview

This article explains the trade-offs of using H2 as a test database for Java applications with jOOQ. It shows why SQL that works on H2 may require syntax changes on SQL Server, describes H2 compatibility modes, and notes that jOOQ generates SQL for H2's native dialect rather than its compatibility modes.

### Source excerpt

The H2 database is an immensely popular in-memory database product mostly used by Java developers for testing. If you check out the DB-Engines ranking, it ranks 50th, which is quite impressive, as this rank outperforms products like: CockroachDB Ignite Single Store (previously MemSQL) Interbase (which was forked as Firebird) Ingres (which is a predecessor to ... Continue reading Using H2 as a Test Database Product 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