Use when you need to write unit tests for Micronaut applications — Mockito-first with @ExtendWith(MockitoExtension.class), @MicronautTest with @MockBean, HttpClient @Client(/) assertions, @Property overrides, @ParameterizedTest, and *Test vs *IT naming. For framework-agnostic Java use @131-java-testing-unit-testing. This should trigger for requests such as Add or improve unit tests in a Micronaut project; Reduce unnecessary @MicronautTest usage with Mockito-first tests; Write Mockito-first unit
SkillScore77Maintained
Automatic
◆QA & Test Engineering pack
Last verified 8/20/2026
What it changes
Passed 15 of 19 test cases with the skill, and 13 of 19 without it.
Specifies executing `./mvnw compile` prior to editing code.
and 3 more in the full report
4 fixed13 passed either way3 still failing2 broke
Pass-rate lift
+9 pp
Tokens
-16%
Agent turns
0%
Response time
-42%
Model gemini-3.6-flashMeasured 8/20/2026v117 of 22 cases passed with skill · 19 comparable
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 4 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 4
Prompt
We have a local Micronaut repository with existing source code. We want to refactor `UserServiceTest.java`. Before applying any edits to code files in this workflow, what command must be executed first?
What was checked, without and with the skill
Checked
Without skill
With skill
Specifies executing `./mvnw compile` prior to editing code.
Missed
Passed
case-09 · gemini-3.6-flash · 8/20/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md56 lines2 files
Micronaut Unit Testing
Apply fast testing strategies for Micronaut: Mockito-first, narrow @MicronautTest when HTTP or DI replacement is required.
What is covered in this Skill?
Pure JUnit 5 + Mockito without container boot
@MicronautTest with @MockBean factory methods for collaborators
HttpClient blocking exchanges against the embedded server
@Property for deterministic configuration in tests
@ParameterizedTest with @CsvSource / @MethodSource
Naming: *Test → Surefire; *IT → Failsafe when configured
When to escalate to @522
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
SAFETY: If compilation fails, stop immediately
VERIFY: Run ./mvnw clean verify or mvn clean verify after applying improvements
BEFORE APPLYING: Read the reference for detailed rules and examples
EDGE CASE: If request scope is ambiguous, stop and ask a clarifying question before applying changes
EDGE CASE: If required inputs, files, or tooling are missing, report what is missing and ask whether to proceed with setup guidance
When to use this skill
Add or improve unit tests in a Micronaut project
Reduce unnecessary @MicronautTest usage with Mockito-first tests
Write Mockito-first unit tests for Micronaut services
Mock Micronaut bean collaborators in unit tests
Review fast Micronaut tests without application context
Workflow
Read reference and assess project context
Read references/521-frameworks-micronaut-testing-unit-tests.md and inspect the current project setup before proposing changes.
Use when you need framework-agnostic OpenAPI 3.x guidance — spec structure, metadata and versioning, paths and operations, reusable schemas, security schemes, examples, documentation quality, contract validation (e.g. Spectral), breaking-change awareness, and handoffs to codegen — without choosing Spring Boot, Quarkus, or Micronaut. This should trigger for requests such as Review an OpenAPI; Improve an OpenAPI; Improve API contract; Improve API schema design. Part of Plinth Toolkit