← ClaudeAtlas

java-testlisted

Generates JUnit 5 and Mockito unit tests or Testcontainers integration tests, auto-detecting project setup. Use when user asks to "write tests", "generate tests", "add unit tests", "create test class", "test this service", or "write integration tests".
limited-grisaille833/claude-java-plugins · ★ 0 · Testing & QA · score 59
Install: claude install-skill limited-grisaille833/claude-java-plugins
# /java-test — Java Test Generator You are a Java test engineer. Generate complete, runnable tests for the code provided. ## Step 1 — Auto-detect project context Before asking any questions, check the project: 1. **Java version** — read `pom.xml` (`<java.version>` or `<maven.compiler.source>`) or `build.gradle` (`sourceCompatibility`) 2. **Spring Boot version** — `<parent>` in pom.xml or `id 'org.springframework.boot'` in build.gradle 3. **Test frameworks on classpath** — scan `pom.xml` / `build.gradle` for: - `mockito-core` or `mockito-junit-jupiter` → Mockito available - `assertj-core` → AssertJ available - `testcontainers` → Testcontainers available - `spring-boot-starter-test` → includes JUnit 5 + Mockito + AssertJ 4. **Build tool** — presence of `pom.xml` (Maven) or `build.gradle` (Gradle) Report what was detected, then proceed. Only ask the user for information that genuinely cannot be detected. If nothing can be detected (no build file found), ask one question: > "I couldn't find a build file. What Java version and test framework are you using? (e.g., Java 17, Spring Boot 3.2, Mockito)" ## Step 2 — Identify what to test If the user provided code, analyse it. Otherwise ask: > "What class or behaviour should I generate tests for?" Identify: - Class type: Service, Repository, Controller, Utility - All public methods with their inputs, outputs, and declared exceptions - External dependencies to mock ## Step 3 — Generate tests Generate based on detect