liveBook · Manning

Continuous testing

As explained in Quarkus in Action

Continuous testing is a development technique that automatically executes tests in the background when source code changes.

Continuous testing runs application tests in the background during Quarkus Dev mode. When a source change triggers a live reload, it generally triggers another test run if continuous testing is enabled. You can keep working with the development application while the tests run: they use a separate class loader and an isolated application instance within the same JVM. section 3.5

To try it with an existing test:

  • With Dev mode running, press `r` in its terminal to start continuous testing. To enable it at application start instead, set `quarkus.test.continuous-testing=enabled`. section 3.5.1
  • Change the response returned by `/hello`, either in the resource or through `application.properties`, and save the file. The test reruns immediately; check the terminal status line for a pass or a failure report. section 3.5.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"));
}

The example uses RestAssured to send `GET /hello` and assert both HTTP 200 and the expected greeting. Changing that greeting makes the next automatic test run a visible check on the edit. section 3.5.1

Results also appear in Dev UI. The first run after starting Dev mode can take longer than subsequent runs; continuous testing does not require you to wait for a run to finish before interacting with the development application. section 3.5.1 section 3.7

How Quarkus in Action covers it

How deep it goes
Explains reload-triggered runs and class-loader isolation, then demonstrates activation and feedback; defers deeper testing-framework capabilities.
Examples
Exercises a RestAssured GET `/hello` test, then changes its expected response through source code or configuration to observe a rerun.
What it assumes
Assumes an application running in Dev mode with an existing test; introduces continuous testing through that test's behavior.
What you can do after
Operate it in Quarkus Dev mode to rerun tests after edits and inspect pass or failure results without stopping development.
How it connects
Connects continuous testing to Dev mode, live reloading, JUnit 5, RestAssured, and Dev UI.

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.