Testing evaluates Quarkus application behavior against expected results while fitting into continuous development, JVM execution, native builds, and packaged applications. Quarkus integrates testing with JUnit 5 and can manage supporting services such as databases and message brokers through Dev Services. section 5.0 section 3.6
Quarkus testing supports several execution and isolation strategies:
- Run tests in the JVM with the application and test logic in a single process. section 2.2.2
- Run integration tests against packaged artifacts, including executable JARs, native images, or containers, with the test JVM separate from the application. section 2.2.2 section 5.6
- Group tests with testing profiles so each group can use a separate application instance and configuration. section 5.0
- Replace CDI beans or define behavior with Mockito when remote or otherwise unsuitable collaborators should not run directly. section 5.0 section 5.6
Testing an HTTP endpoint
A JUnit test annotated with @QuarkusTest can call /hello through REST Assured and assert both the HTTP status and response body. A matching @QuarkusIntegrationTest can extend that test class to execute the same checks against the packaged application. section 2.2.2
Listing 2.5 Quarkus test example with REST Assured
package org.acme;
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
@QuarkusTest
public class GreetingResourceTest {
@Test
public void testHelloEndpoint() {
given()
.when().get("/hello")
.then()
.statusCode(200) #1
.body(is("Hello from Quarkus REST")); #2
}
}
Inspect a complete Quarkus and REST Assured test that verifies an endpoint response. section 2.2.2




















































