migrate-groovy-to-java
Skill by DataDog
Converts Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests. Built for developers who want to replace .groovy test files with .java equivalents. It checks that tests still pass and the test count is unchanged.
Install migrate-groovy-to-java
Built from the published package, never by AI.
git clone --depth 1 https://github.com/DataDog/dd-trace-java /tmp/dd-trace-java && mkdir -p ~/.claude/skills && cp -r /tmp/dd-trace-java/.agents/skills/migrate-groovy-to-java ~/.claude/skills/migrate-groovy-to-javaRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/DataDog/dd-trace-java /tmp/dd-trace-java && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/dd-trace-java/.agents/skills/migrate-groovy-to-java ~/.gemini/antigravity-cli/skills/migrate-groovy-to-javaAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install migrate-groovy-to-java in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill converts Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests. It lists the module's Groovy files, converts them, checks that the tests still pass and the test count has not changed, then removes the Groovy files.
The skill prefers @TableTest for Spock where: tables and uses @MethodSource for complex cases. It targets JDK 8 compatible output, uses libs.bundles.mockito for Spock Mock usage, and converts static injectSysConfig calls to @WithConfig. It is intended for developers who want to replace .groovy test files with .java equivalents in a Gradle module.
Written from the project's SKILL.md and checked against it.
What it can do
- List Groovy test filesLists all Groovy files of the current Gradle module as the first migration step.
- Convert to JUnit 5Converts Spock/Groovy tests to Java tests using JUnit 5.
- Map Spock where tablesTurns Spock where: data rows into @TableTest with a scenario column.
- Use MethodSource for complex casesCombines @TableTest and @MethodSource when only some cases need programmatic setup.
- Replace config injectionReplaces static injectSysConfig calls with @WithConfig where key and value are literals.
- Verify migrationChecks that tests still pass and the test count has not changed after migration.
- Remove Groovy filesRemoves the Groovy test files once the Java equivalents are in place.
What you need
- A Gradle module containing Spock/Groovy test files
- JDK 8 compatible output target
- JUnit 5 and libs.bundles.mockito in the build, where Mock usage is converted
Try asking
- Migrate the groovy tests in this module to java
- Convert the Spock tests in this Gradle module to JUnit 5
- g2j this module and confirm the test count is unchanged
Good to know
- Generated Java must be compatible with JDK 8, so no text blocks are used.
- @TableTest is not used when the majority of rows need complex objects or custom converters.
- The skill reads a QUALITY_RULES.md file in .claude/skills/migrate-groovy-to-java before writing Java.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/migrate-groovy-to-java/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
QUALITY_RULES.md18 KB -
SKILL.md5 KB
Alternatives to migrate-groovy-to-java
All alternatives →Runs the full Next.js deployment test suite for an internal vercel/next.js pull request. It validates the commit's preview package, then dispatches the test_e2e_deploy_release.yml workflow. Meant for maintainers who explicitly ask for the entire suite.
Instruments Python AI applications with DeepEval's native tracing so their execution appears span by span in Confident AI's Observatory. It is for developers building LLM apps, agents, RAG pipelines and chatbots.
Manages Azure Container Registry through the az acr Azure CLI command group. It covers registries, images, cloud builds, ACR Tasks, tokens, geo-replication and networking. Built for developers and operators who work with ACR in Azure.
Opens, runs, and shows apps on a temporary Crabbox machine, including native desktops and web previews. It is for OpenClaw users who want an app running and visible in their chat side panel.
Runs batch and HPC workloads on GKE using job queues and parallel processing. Aimed at teams running batch pipelines, HPC simulations, or ML training jobs on Google Kubernetes Engine.
Answers questions about GKE cluster and workload costs using BigQuery billing exports and live cluster metrics. Built for platform engineers and cloud teams who need to analyze and diagnose GKE spend.
Compare with deploy-release-test, deepeval-tracing or azure-container-registry-cli
migrate-groovy-to-java: common questions
Does the migration keep the same number of tests?
The skill checks that the tests are still passing and that the test count has not changed after migration.
Which Java version does the output target?
The generated Java code is meant to be compatible with JDK 8.
How are Spock where: tables converted?
The skill prefers @TableTest for tabular data rows, and uses @MethodSource only when tabular form is not practical.
How do I install migrate-groovy-to-java?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is migrate-groovy-to-java free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is migrate-groovy-to-java safe to use?
It scores 76 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to migrate-groovy-to-java?
Similar skills: deploy-release-test, deepeval-tracing, azure-container-registry-cli, crabbox-apps.
