REST Assured is a Java library for calling HTTP endpoints in tests and asserting their responses. In Quarkus tests, it provides a direct way to check a REST resource through HTTP rather than calling its methods directly. Quarkus manages the server URL used by REST Assured, so ordinary requests do not need to name the server under test. section 5.2.1
Listing 3.9 Source code for a simple test
@Test
void testHelloEndpoint() {
given()
.when().get("/hello")
.then()
.statusCode(200)
.body(is("Hello from Quarkus REST"));
}
This test sends GET /hello, checks for HTTP status 200, and asserts the exact response body. The given–when–then chain keeps the request and expected result together. section 3.5.1
To use REST Assured in a Quarkus test:
- Add the test-scoped io.rest-assured:rest-assured dependency to pom.xml if the project did not include generated tests and their dependencies. section 5.2.1
- Use @QuarkusTest for the test class. When a test needs a particular endpoint's URL, combine @TestHTTPEndpoint with @TestHTTPResource to inject it. section 5.2.1
Testing a reservation
A resource test creates and submits a reservation, then checks that an ID was assigned. It chooses a start day other than today to avoid a call to the Rental service, and does not exercise the availability method, which needs the Inventory service. That keeps this test focused; the Inventory call is left for a test using a mock. section 5.2.1
For a quick feedback loop, run the application with quarkus dev and press r to run tests. A changed greeting can make an exact-body assertion fail; restore the expected response or update the test to match the intended behavior. This development-mode test is distinct from a Quarkus integration-test subclass used for native mode. section 3.5.1 section 5.2.1

