JVM Testing Workflow
Purpose
Run and explain JVM backend tests without assuming one language or build tool owns the platform.
The practical decision is which module to test, which build tool command is authoritative, which test framework is already in use, and whether a failure is toolchain, dependency, compile, discovery, execution, or output related.
When To Use
- Use this skill when the user asks to run, add, debug, or explain JVM backend tests.
- Use this skill after changing Java or Scala service behavior.
- Use this skill when Gradle, Maven, or SBT test commands fail.
- Use this skill when deciding whether to run module-level or repository-level tests.
Source Check
Use repo-local JVM files, checked-out dependency sources, Dash MCP or Dash HTTP for installed JVM docsets, and then official or canonical documentation when Dash/local coverage is missing or stale:
Inspect the repository before running broad checks:
rg --files -g 'settings.gradle' -g 'settings.gradle.kts' -g 'build.gradle' -g 'build.gradle.kts' -g 'pom.xml' -g 'build.sbt' -g '*.java' -g '*.scala'
Test Selection
Choose the narrowest useful test command first:
- changed Gradle module:
./gradlew :module:test
- changed Maven module:
mvn -pl module -am test
- changed SBT module:
sbt module/test
- changed shared library used broadly: run the affected module tests, then the broader project tests before commit
- dependency or toolchain issue: run the compile or dependency phase before behavior tests
- no test surface exists: run compile/build and report the missing test gap
Use the repository's documented commands when they differ.
Test Framework Choice
Preserve the repository's current test framework.
For new Java test surfaces, prefer the repo's existing JUnit, AssertJ, Mockito, Spring test, Quarkus test, Micronaut test, or other framework-specific pattern.
For new Scala test surfaces, prefer the repo's existing ScalaTest, MUnit, Weaver, specs2, ZIO Test, or Cats Effect testing pattern.
Do not migrate test frameworks as part of ordinary behavior work.
Failure Triage
Classify failures by phase:
- toolchain selection
- dependency resolution
- compile
- generated source or annotation processing
- test discovery
- test execution
- logger, report, or output generation
Report:
- exact command
- module or project
- phase
- first meaningful error
- likely cause
- smallest useful next check
Java Test Notes
For Java tests:
- preserve JUnit version and assertion style
- avoid broad mocks when a small value-based test proves the behavior
- test domain logic without full framework startup when practical
- add service or integration tests when serialization, persistence, auth, or framework wiring changed
Scala Test Notes
For Scala tests:
- preserve ScalaTest, MUnit, Weaver, or repo-selected style
- test pure transformations directly where practical
- keep effectful tests aligned with the repository's effect runtime
- avoid Java-shaped fixtures when small Scala values or generators would be clearer
Output Shape
Return:
Command: exact test command.
Scope: module, project, repository, or targeted filter.
Result: pass, fail, skipped, or blocked.
Failure phase: toolchain, dependency, compile, discovery, execution, or output.
Next step: smallest useful fix or broader validation.
Guardrails
- Do not run multiple build or test commands concurrently.
- Do not replace an existing test framework unless the user explicitly asks for that migration.
- Do not hide compile or dependency failures under a generic "tests failed" summary.
- Do not skip tests after behavior changes when a relevant test surface exists.
- Do not route Android instrumentation or emulator work through this skill.
1---2name: testing-workflow-33description: Run, filter, debug, and explain server-side JVM tests across Gradle, Maven, SBT, Java, Scala, JUnit, ScalaTest, MUnit, unit, integration, contract, and service-level test surfaces.4license: Apache-2.05---67# JVM Testing Workflow89## Purpose1011Run and explain JVM backend tests without assuming one language or build tool owns the platform.1213The practical decision is which module to test, which build tool command is authoritative, which test framework is already in use, and whether a failure is toolchain, dependency, compile, discovery, execution, or output related.1415## When To Use1617- Use this skill when the user asks to run, add, debug, or explain JVM backend tests.18- Use this skill after changing Java or Scala service behavior.19- Use this skill when Gradle, Maven, or SBT test commands fail.20- Use this skill when deciding whether to run module-level or repository-level tests.2122## Source Check2324Use repo-local JVM files, checked-out dependency sources, Dash MCP or Dash HTTP for installed JVM docsets, and then official or canonical documentation when Dash/local coverage is missing or stale:2526- [Gradle Java testing documentation](https://docs.gradle.org/current/userguide/java_testing.html)27- [Maven Surefire Plugin documentation](https://maven.apache.org/surefire/maven-surefire-plugin/)28- [SBT testing documentation](https://www.scala-sbt.org/1.x/docs/Testing.html)29- [JUnit 5 User Guide](https://junit.org/junit5/docs/current/user-guide/)30- [ScalaTest User Guide](https://www.scalatest.org/user_guide)31- [MUnit documentation](https://scalameta.org/munit/)3233Inspect the repository before running broad checks:3435```bash36rg --files -g 'settings.gradle' -g 'settings.gradle.kts' -g 'build.gradle' -g 'build.gradle.kts' -g 'pom.xml' -g 'build.sbt' -g '*.java' -g '*.scala'37```3839## Test Selection4041Choose the narrowest useful test command first:4243- changed Gradle module: `./gradlew :module:test`44- changed Maven module: `mvn -pl module -am test`45- changed SBT module: `sbt module/test`46- changed shared library used broadly: run the affected module tests, then the broader project tests before commit47- dependency or toolchain issue: run the compile or dependency phase before behavior tests48- no test surface exists: run compile/build and report the missing test gap4950Use the repository's documented commands when they differ.5152## Test Framework Choice5354Preserve the repository's current test framework.5556For new Java test surfaces, prefer the repo's existing JUnit, AssertJ, Mockito, Spring test, Quarkus test, Micronaut test, or other framework-specific pattern.5758For new Scala test surfaces, prefer the repo's existing ScalaTest, MUnit, Weaver, specs2, ZIO Test, or Cats Effect testing pattern.5960Do not migrate test frameworks as part of ordinary behavior work.6162## Failure Triage6364Classify failures by phase:6566- toolchain selection67- dependency resolution68- compile69- generated source or annotation processing70- test discovery71- test execution72- logger, report, or output generation7374Report:7576- exact command77- module or project78- phase79- first meaningful error80- likely cause81- smallest useful next check8283## Java Test Notes8485For Java tests:8687- preserve JUnit version and assertion style88- avoid broad mocks when a small value-based test proves the behavior89- test domain logic without full framework startup when practical90- add service or integration tests when serialization, persistence, auth, or framework wiring changed9192## Scala Test Notes9394For Scala tests:9596- preserve ScalaTest, MUnit, Weaver, or repo-selected style97- test pure transformations directly where practical98- keep effectful tests aligned with the repository's effect runtime99- avoid Java-shaped fixtures when small Scala values or generators would be clearer100101## Output Shape102103Return:1041051. `Command`: exact test command.1062. `Scope`: module, project, repository, or targeted filter.1073. `Result`: pass, fail, skipped, or blocked.1084. `Failure phase`: toolchain, dependency, compile, discovery, execution, or output.1095. `Next step`: smallest useful fix or broader validation.110111## Guardrails112113- Do not run multiple build or test commands concurrently.114- Do not replace an existing test framework unless the user explicitly asks for that migration.115- Do not hide compile or dependency failures under a generic "tests failed" summary.116- Do not skip tests after behavior changes when a relevant test surface exists.117- Do not route Android instrumentation or emulator work through this skill.