Write, review, and run tests in a Quarkus project alongside tdd-test-list and tdd-cycle, never instead of them. Use for any request to write or run tests in Quarkus, and on @QuarkusTest, @QuarkusIntegrationTest, @InjectMock, QuarkusMock, @TestTransaction, REST Assured, Dev Services, or [TEST] comments in a Java test. Covers plain-JVM versus @QuarkusTest tiers, quarkus test continuous testing and the Maven/Gradle runners (mvnw verify, gradlew quarkusIntTest), the first red as a javac error and the stub convention, where the [TEST] list lives, test naming, @InjectMock versus QuarkusMock, and the *IT extends *Test companion. Also trigger on @QuarkusTest on a class with no container dependency, a mock of the class the test is named after, or an assertion on Hibernate, Jackson, or CDI behavior. Not for TDD process rules (tdd-test-list, tdd-cycle) or for project creation, versions, and extension management (quarkus-app).
97%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
The Quarkus tier under the tdd-* skills. tdd-test-list decides what goes on the list and in what order; tdd-cycle decides when a test is red, what green may change, when to refactor and commit. This skill decides how Quarkus runs that loop: which tier a test belongs to, what to run at each step, how the first red looks in Java, and which test tooling to use. If a rule here appears to conflict with a tdd-* rule, the tdd-* rule wins and this file has a bug.
Load order. tdd-test-list (the list exists), tdd-cycle (the loop), then this file, then exactly one reference: references/tdd-cycle.md for the loop in Java/Quarkus, references/testing.md for test tooling.
Red Flags — STOP if you find yourself thinking:
@QuarkusTest on a plain Java class's test." (If a class with no container dependency needs the container to be tested, it has acquired one — fix the class, not the test.)@QuarkusTest included, after every red." (The plain-JVM tier runs every step; the container tiers run at green and after refactoring — continuous testing makes that free.)CancelOrderApplicationServiceTest." (Never the class the test is named after.)@InjectMock and QuarkusMock.installMockForType for the same bean, to be safe." (One mechanism per mock.)return null; to make it compile." (Stubs throw UnsupportedOperationException so a stub reached by accident is a red, not a silent pass.)| Concern | Default | Alternative (say why) |
|---|---|---|
| Runner during the loop | quarkus test (continuous testing, Maven or Gradle) in a second terminal; it reruns affected tests on save | One class on demand: ./mvnw test -Dtest=OrderTest or ./gradlew test --tests OrderTest |
| Runner at the end | Maven: ./mvnw verify -DskipITs=false; Gradle: ./gradlew build quarkusIntTest — before a PR | ./mvnw verify when the project runs ITs by default |
| Assertions | AssertJ (assertThat, assertThatThrownBy); Hamcrest only inside REST Assured body(...) | JUnit Assertions if AssertJ is not on the classpath — add it |
| Plain-JVM tier (no container dependency) | Plain JUnit 5, no Quarkus annotations, no container | — |
| Container tier (beans, repositories) | @QuarkusTest + Dev Services PostgreSQL with the real repository implementation; @TestTransaction | A hand-rolled in-memory fake of the repository interface when the test is about orchestration only |
| HTTP tier (resources) | @QuarkusTest + REST Assured; @InjectMock on the service the resource calls | — |
| Doubles | @InjectMock for collaborators; QuarkusMock.installMockForType/Instance for the three cases in references/testing.md; never a domain type, never the class under test | — |
| Integration | class FooIT extends FooTest {} with @QuarkusIntegrationTest — for black-box tests only (REST Assured, no @Inject, @InjectMock, or @TestTransaction); Maven: check skipITs in pom.xml; Gradle: ITs run only through quarkusIntTest | — |
| Test dependencies | quarkus-junit5, quarkus-junit5-mockito, rest-assured, org.assertj:assertj-core (test scope), archunit-junit5 — added by quarkus-app, never by hand | — |
@QuarkusTest when the class needs the container: beans with injected collaborators, repositories against Dev Services, resources through REST Assured. One test class per production class, in the matching test package.tdd-cycle Rule 7) costs per tier. The plain-JVM tier runs at every red and green — milliseconds. The @QuarkusTest tiers run at every green commit and after each refactoring; with quarkus test running they are already green or already red by the time you look. verify with ITs runs before the PR, not inside the loop.tdd-cycle Rule 5's two steps in Java: the test names a class or method that doesn't exist → javac fails → add the type or method with a body of throw new UnsupportedOperationException(); (never return null) → the AssertJ failure is the second red. Constructors and records that must exist get their parameters and nothing else.// [TEST] ... comments, in list order; the line is deleted at the green commit that completes it (tdd-test-list Rule 7), so during red the item is still on the list. Items discovered while going green are appended there (tdd-test-list Rule 6).cancelling_a_fulfilled_order_is_refused. The class is <ProductionClass>Test; no should, no test prefix.@InjectMock is the default double. Declare the field, stub in @BeforeEach with Mockito.when(...). QuarkusMock.installMockForType only for the three cases (programmatic construction, normal-scoped replacement visible to other beans, a different whole instance per test — installMockForInstance(perTest, bean), whose second argument is the @Injected normal-scoped bean, i.e. its client proxy). Never both for one bean. @Singleton beans cannot be replaced. All of these, @InjectMock included, replace beans globally: do not run @QuarkusTest classes that mock beans in parallel.Clock.given().when().post(...).then().statusCode(200).body("status", equalTo("CANCELLED")). The path in the test is the path the resource declares; fix the test, not the resource.@TestTransaction. Real PostgreSQL, rolled back per test. Inject the domain interface, not the Panache class. Never a manual Testcontainer beside Dev Services.@QuarkusTest classes get an *IT extends *Test companion so the packaged artifact runs the same suite. Black-box means REST Assured against the running app and nothing from the test JVM: no @Inject, @InjectMock, QuarkusMock, or @TestTransaction — the IT runs the app in a separate process and those are unavailable, so a companion for such a test fails or tests the wrong thing. Know whether Maven sets <skipITs>true</skipITs>; on Gradle, ITs run only through quarkusIntTest.tdd-cycle Rule 12 with git: at green, feat:/fix: naming the behavior; after refactoring, refactor: naming the move. Commit the cycle's files by path (git commit -m "..." -- <paths>), never -a, so unrelated changes in the tree are left alone. In human mode the red step is test: <behavior> with the failing test alone, so the history shows the test came first.Load exactly one, for the concern at hand.
| Doing… | Read | Pairs with |
|---|---|---|
The loop in Java/Quarkus: a [TEST] list, a plain-JVM cycle, a @QuarkusTest cycle, the commits, a "passed without red" callout | references/tdd-cycle.md | tdd-cycle, tdd-test-list |
A @QuarkusTest: doubles, REST Assured, Dev Services, @TestTransaction, the IT companion, QuarkusMock | references/testing.md | tdd-cycle Rule 13 |
[TEST] item has a tier, and the test class sits in the matching package.quarkus test is running; the plain-JVM tier is green before every commit; container tiers are green at every green commit.javac failure; stubs throw UnsupportedOperationException.[TEST] list is at the bottom of the test class and shrinks at each green commit.<Production>Test; black-box @QuarkusTest classes have an *IT companion.@InjectMock on collaborators only; no mock of the class under test or of a domain type; no bean mocked two ways.@TestTransaction, domain interface injected.tdd-test-list, tdd-cycle — the process this skill runs. Written against tdd-skills 1.x; Core Rule numbers cited here and in references/ refer to that version.quarkus-app — the project, the extensions, the test dependencies.jeremyrdavis/agentic-skills-for-quarkus
c0aa65a
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.