liveBook · Manning

Integration test

As explained in Quarkus in Action

An integration test evaluates an application or component together with externally packaged or connected components.

An integration test evaluates an application with externally packaged or connected components. In Quarkus, the test JVM runs separately from the application artifact and exercises only its exposed API, unlike a same-JVM Quarkus test. section 2.2.2

A practical integration-test flow:

  • Annotate a test with @QuarkusIntegrationTest to run it against packaged application artifacts. section 2.2.2
  • Reuse endpoint assertions from a @QuarkusTest class when the same behavior applies in both execution modes. section 2.2.2
  • Exercise REST endpoints with REST Assured and verify status codes and response bodies. section 2.2.2
  • For messaging, inject KafkaCompanion, stub unavailable REST clients, invoke the API, and verify that the expected Kafka message was produced. section 9.6.2

Verifying a Kafka invoice adjustment

A rental-service test mocks the ReservationClient, starts and ends a rental through REST, then listens on the invoices-adjust Kafka topic to confirm that the prolonged rental produced an invoice-adjustment message. section 9.6.2

Listing 2.6 Quarkus integration test
package org.acme;

import io.quarkus.test.junit.QuarkusIntegrationTest;

@QuarkusIntegrationTest
public class GreetingResourceIT extends GreetingResourceTest {
    // Execute the same tests but in packaged mode.
}

Inspect the packaged-mode test that inherits the endpoint checks and runs them against the built application. section 2.2.2

How Quarkus in Action covers it

How deep it goes
Demonstrates separate-JVM execution, reusable REST assertions, mocked clients, and Kafka message verification.
Examples
Uses a GreetingResource endpoint and a rental workflow that verifies an invoices-adjust Kafka message.
What you can do after
Apply it via Quarkus annotations and KafkaCompanion to verify packaged APIs and produced broker messages.
How it connects
Connects Quarkus testing with REST Assured, JUnit 5, Mockito, Kafka, and packaged application artifacts.

Also explained in

Compare how 31 books explain integration test →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.