DEV Community

Markus
Markus

Posted on • Originally published at the-main-thread.com on

Mastering API Testing with Quarkus: From RestAssured to Pact and jqwik

Hero Image

APIs are the backbone of modern applications, and their credibility depends entirely on how much clients can trust them. A broken response, an undocumented change, or a missed edge case can ripple across teams and systems in seconds. That’s why testing isn’t optional, it’s the safety net that keeps your services reliable as they evolve. In this hands-on tutorial, we’ll build a simple Quarkus API and put it under a full spectrum of tests: quick example-based checks with RestAssured, container-backed integration using Dev Services, contract verification through Pact, and property-based exploration with jqwik to uncover the unexpected.

Prerequisites, versions, and environment

  • JDK 21
  • Maven 3.9+
  • Podman or Docker installed and running (Dev Services will pull containers automatically)

Project bootstrap and dependencies

Create the project with Maven (or grab it from my Github repository)

mvn io.quarkus.platform:quarkus-maven-plugin:create \
  -DprojectGroupId=org.acme \
  -DprojectArtifactId=quarkus-api-testing \
  -DclassName="org.acme.todo.TodoResource" \
  -Dpath="/api/todos" \
  -Dextensions="rest-jackson,hibernate-orm-panache,jdbc-postgresql, hibernate-validator"
cd quarkus-api-testing
Enter fullscreen mode Exit fullscreen mode

And follow the remaining steps in the original tutorial on The Main Thread

Top comments (0)