Share feedback
Answers are generated based on the documentation.

Testing Quarkus applications with Testcontainers

Table of contents

Learn how to create a Quarkus REST API with Hibernate ORM with Panache and PostgreSQL, then test it using Quarkus Dev Services, Testcontainers, and REST Assured.
Time to complete 25 minutes

In this guide, you'll learn how to:

  • Create a Quarkus application with REST API endpoints
  • Use Hibernate ORM with Panache and PostgreSQL for persistence
  • Test the REST API using Quarkus Dev Services, which uses Testcontainers behind the scenes
  • Test with services not supported by Dev Services using QuarkusTestResourceLifecycleManager

Prerequisites

  • Java 17+
  • Maven or Gradle
  • A Docker environment supported by Testcontainers
Note

If you're new to Testcontainers, visit the Testcontainers overview to learn more about Testcontainers and the benefits of using it.

Modules

  1. Create the project

    Set up a Quarkus project with Hibernate ORM with Panache, PostgreSQL, Flyway, and REST API endpoints.

  2. Write tests

    Test the Quarkus REST API using Dev Services with Testcontainers, and test with services not supported by Dev Services.

  3. Run tests

    Run your Testcontainers-based Quarkus integration tests and explore next steps.