Skip to main content
skill CX Codex

421-frameworks-quarkus-testing-unit-tests — Claude Code skill

Sets up fast unit tests for Quarkus by prioritizing plain Mockito over heavy test containers. It also manages CDI mocking and REST Assured tests.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add jabrena/plinth --skill 421-frameworks-quarkus-testing-unit-tests -a claude-code
Open on GitHub

What 421-frameworks-quarkus-testing-unit-tests does

This skill shifts Quarkus service tests to plain JUnit 5 with @ExtendWith(MockitoExtension.class). The heavier @QuarkusTest container boots only when CDI injection is strictly necessary. For CDI-managed components, it applies @InjectMock for full replacements or @InjectSpy for partial method overrides. It also structures HTTP checks with REST Assured and collapses duplicate tests via @ParameterizedTest.

A rigid compilation check governs the entire workflow. The project must compile cleanly with ./mvnw compile before any test changes begin. If compilation fails, the agent must halt immediately. Once edits are complete, ./mvnw clean verify validates the whole suite.

Test naming dictates test phases. Suffixes ending in Test run early in Maven Surefire. Suffixes ending in IT are reserved for Failsafe integration runs.

What it helps with

  • speed up slow test suites burdened by @QuarkusTest
  • write pure unit tests without booting the CDI runtime
  • mock CDI dependencies partially using @InjectSpy
  • consolidate repetitive test cases with @ParameterizedTest

Example prompts for the agent

  • Refactor order service tests to use pure Mockito without booting Quarkus
  • Add partial mocking with @InjectSpy to this Quarkus test
  • Convert duplicate test methods to a @ParameterizedTest with @CsvSource

How to install 421-frameworks-quarkus-testing-unit-tests

1Skills CLI (Vercel)

npx skills add jabrena/plinth --skill 421-frameworks-quarkus-testing-unit-tests -a claude-code

2Manually: put the files in place

~/.claude/skills/421-frameworks-quarkus-testing-unit-tests/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/421-frameworks-quarkus-testing-unit-tests/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about 421-frameworks-quarkus-testing-unit-tests

How to install 421-frameworks-quarkus-testing-unit-tests in Claude Code?

Run npx skills add jabrena/plinth --skill 421-frameworks-quarkus-testing-unit-tests -a claude-code. Alternatively, copy the skill definition to ~/.claude/skills/421-frameworks-quarkus-testing-unit-tests/SKILL.md.

What does 421-frameworks-quarkus-testing-unit-tests do?

It establishes a Mockito-first testing pattern in Quarkus, reserving @QuarkusTest for situations where CDI wiring or REST Assured assertions are explicitly needed.

What is required before applying test refactorings with this skill?

The codebase must build without errors. Running ./mvnw compile or mvn compile is mandatory, and any compilation failure stops the agent before it touches test files.

Source text

SKILL.md · Apache-2.0
---
name: 421-frameworks-quarkus-testing-unit-tests
description: Use when you need to write fast unit tests for Quarkus applications — including pure tests with @ExtendWith(MockitoExtension.class), @QuarkusTest with @InjectMock for full CDI mock replacement, @InjectSpy for partial CDI bean mocking, REST Assured for resource-focused tests, @ParameterizedTest with @CsvSource / @MethodSource, QuarkusTestProfile for test-specific configuration overrides, and naming conventions (*Test → Surefire, *IT → Failsafe). For framework-agnostic Java use @131-java-testing-unit-testing. This should trigger for requests such as Add or improve unit tests in a Quarkus project; Reduce slow @QuarkusTest usage with Mockito-first tests; Add @InjectSpy partial mocking or QuarkusTestProfile configuration in Quarkus tests; Convert repeated test methods to @ParameterizedTest with @CsvSource or @MethodSource; Write fast pure unit tests for Quarkus services. Part of Plinth Toolkit
license: Apache-2.0
metadata:
  author: Juan Antonio Breña Moral
  version: 0.19.0
---
# Quarkus Unit Testing

Apply fast testing strategies for Quarkus: Mockito-first, QuarkusTest when CDI wiring matters.

**What is covered in this Skill?**

- Pure JUnit 5 + Mockito without container boot (@ExtendWith(MockitoExtension.class))
- @QuarkusTest with @InjectMock for full CDI bean replacement
- @InjectSpy for partial mocking — real bean wrapped as spy, specific methods overridden
- REST Assured for HTTP-level @QuarkusTest resource tests
- @ParameterizedTest with @CsvSource (inline data) and @MethodSource (complex objects)
- QuarkusTestProfile and @TestProfile for test-specific configuration overrides
- Naming conventions: *Test → Surefire (fast phase), *IT → Failsafe (verify phase)
- When to escalate to integration tests (`@422`)

**Scope:** Apply recommendations based on the reference rules and good/bad code examples.

## Constraints

Compile before test refactors; verify the full suite after.

- **MANDATORY**: Run `./mvnw compile` or `mvn compile` before applying any change
- **PREREQUISITE**: Project must compile before applying test improvements
- **SAFETY**: If compilation fails, stop immediately
- **BLOCKING CONDITION**: Compilation errors must be resolved by the user before proceeding
- **VERIFY**: Run `./mvnw clean verify` or `mvn clean verify` after applying improvements
- **BEFORE APPLYING**: Read the reference for detailed rules and examples

## When to use this skill

- Add or improve unit tests in a Quarkus project
- Reduce slow @QuarkusTest usage with Mockito-first tests
- Add @InjectSpy partial mocking or QuarkusTestProfile configuration in Quarkus tests
- Convert repeated test methods to @ParameterizedTest with @CsvSource or @MethodSource
- Write fast pure unit tests for Quarkus services

## Workflow

1. **Read reference and assess project context**

Read `references/421-frameworks-quarkus-testing-unit-tests.md` and inspect the current project setup before proposing changes.

2. **Gather scope and decide target improvements**

Identify requested outcomes, constraints, and the minimum safe set of changes to apply.

3. **Apply framework-aligned changes**

Implement or refactor configuration/code following the reference patterns and project conventions.

4. **Run verification and report results**

Execute appropriate build/tests and summarize what changed, what was verified, and any follow-up actions.

## Reference

For detailed guidance, examples, and constraints, see [references/421-frameworks-quarkus-testing-unit-tests.md](references/421-frameworks-quarkus-testing-unit-tests.md).

© Juan Antonio Breña Moral · Apache-2.0 · jabrena/plinth

Similar skills

All skills for Backend and APIs →

From the same set51

200-agents-md Builds an AGENTS.md file for Java repositories via an interactive step-by-step interview. It organizes project stack, Git rules, and AI contributor boundaries. CX Codex +1 326installs 012-agile-epic The skill walks the agent through template questions and produces a Markdown epic: business value, scope, success criteria, risks. CX Codex +1 326installs 323-frameworks-spring-boot-testing-acceptance-tests Turns maintainer-sanitized Gherkin scenarios into Spring Boot acceptance tests with TestRestTemplate, Testcontainers and WireMock. CX Codex +1 324installs 401-frameworks-quarkus-core A skill that reviews and fixes the core of a Quarkus app: CDI beans, profiles, interceptors, virtual threads. Useful once the Java project already compiles. CX Codex +1 321installs 114-java-maven-search Reads outdated dependency and plugin reports from your pom.xml and helps verify Maven artifact coordinates from approved evidence. CX Codex +1 315installs 413-frameworks-quarkus-db-migrations-flyway A skill that has your coding agent add and review Flyway migrations in a Quarkus app: the quarkus-flyway extension, SQL scripts, config and ordering. CX Codex +1 313installs 422-frameworks-quarkus-testing-integration-tests Configures integration tests for Quarkus apps, from Dev Services and WireMock stubs to @QuarkusIntegrationTest native checks. CX Codex +1 311installs 411-frameworks-quarkus-jdbc A skill for programmatic JDBC in Quarkus: Agroal DataSource, parameterized SQL, transactions, batching and Dev Services. Useful when reviewing data access. CX Codex +1 312installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor