java-junit
Get best practices for JUnit 5 unit testing, including data-driven tests
Skill by eiei114
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/eiei114-java-junit
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/java-junit
What's inside
- Skill name
java-junit- Description
- Get best practices for JUnit 5 unit testing, including data-driven tests
- License
- MIT
- Instructions
- 60 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# JUnit 5+ Best Practices
Your goal is to help me write effective unit tests with JUnit 5, covering both standard and data-driven testing approaches.
## Project Setup
- Use a standard Maven or Gradle project structure.
- Place test source code in `src/test/java`.
- Include dependencies for `junit-jupiter-api`, `junit-jupiter-engine`, and `junit-jupiter-params` for parameterized tests.
- Use build tool commands to run tests: `mvn test` or `gradle test`.
## Test Structure
- Test classes should have a `Test` suffix, e.g., `CalculatorTest` for a `Calculator` class.
- Use `@Test` for test methods.
- Follow the Arrange-Act-Assert (AAA) pattern.
- Name tests using a descriptive convention, like `methodName_should_expectedBehavior_when_scenario`.
- Use `@BeforeEach` and `@AfterEach` for per-test setup and teardown.
- Use `@BeforeAll` and `@AfterAll` for per-class setup and teardown (must be static methods).
- Use `@DisplayName` to provide a human-readable name for test classes and methods.
## Standard Tests
- Keep tests focused on a single behavior.
- Avoid testing multiple conditions in one test method.
- Make tests independent and idempotent (can run in any order).
- Avoid test interdependencies.
## Data-Driven (Parameterized) Tests
- Use `@ParameterizedTest` to mark a method as a parameterized test.
- Use `@ValueSource` for simple literal values (strings, ints, etc.).
- Use `@MethodSource` to refer to a factory method that provides test arguments as a `Stream`, `Collection`, etc.
- Use `@CsvSource` for inline comma-separated values.
- Use `@CsvFileSource` to use a CSV file from the classpath.
- Use `@EnumSource` to use enum constants.
## Assertions
- Use the static methods from `org.junit.jupiter.api.Assertions` (e.g., `assertEquals`, `assertTrue`, `assertNotNull`).
- For more fluent and readable assertions, consider using a library like AssertJ (`assertThat(...).is...`).
- Use `assertThrows` or `assertDoesNotThrow` to test for exceptions.
- Group related assertions with `assertAll` to ensure all assertions are checked before the test fails.
- Use descriptive messages in assertions to provide clarity on failure.
## Mocking and Isolation
- Use a mocking framework like Mockito to create mock objects for dependencies.
- Use `@Mock` and `@InjectMocks` annotations from Mockito to simplify mock creation and injection.
- Use interfaces to facilitate mocking.
## Test Organization
- Group tests by feature or component using packages.
- Use `@Tag` to categorize tests (e.g., `@Tag("fast")`, `@Tag("integration")`).
- Use `@TestMethodOrder(MethodOrderer.OrderAnnotation.class)` and `@Order` to control test execution order when strictly necessary.
- Use `@Disabled` to temporarily skip a test method or class, providing a reason.
- Use `@Nested` to group tests in a nested inner class for better organization and structure.From eiei114/claude-code-template, MIT.
More from eiei114/claude-code-template
- 0.404score
csharp-nunit
eiei114
Get best practices for NUnit unit testing, including data-driven tests
SkillDFreshness: DClaude Code +9 - 0.399score
playwright-generate-test
eiei114
Generate a Playwright test based on a scenario using Playwright MCP
SkillDFreshness: DClaude Code +9 - 0.396score
playwright-explore-website
eiei114
Website exploration for testing using Playwright MCP
SkillDFreshness: DClaude Code +9 - 0.390score
mcp-builder
eiei114
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools.
SkillDFreshness: DClaude Code +9 - 0.385score
algorithmic-art
eiei114
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration.
SkillDFreshness: DClaude Code +9 - 0.385score
pdf
eiei114
Use this skill whenever the user wants to do anything with PDF files.
SkillDFreshness: DClaude Code +9 - 0.385score
frontend-design
eiei114
Create distinctive, production-grade frontend interfaces with high design quality.
SkillDFreshness: DClaude Code +9 - 0.385score
brand-guidelines
eiei114
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel.
SkillDFreshness: DClaude Code +9 - 0.385score
canvas-design
eiei114
Create beautiful visual art in .png and .pdf documents using design philosophy.
SkillDFreshness: DClaude Code +9 - 0.385score
doc-coauthoring
eiei114
Guide users through a structured workflow for co-authoring documentation.
SkillDFreshness: DClaude Code +9 - 0.380score
grill-me
eiei114
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree.
SkillDFreshness: DClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Apr 19, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/eiei114/claude-code-template
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from eiei114
- 0.609score
idea-to-build
eiei114
Start a local Hermes Idea-to-Build session after the human explicitly invokes this skill.
SkillAFreshness: A★ 4Claude Code +9 - 0.609score
maintenance-build
eiei114
Start the Hermes Maintenance Multica workflow after the human explicitly invokes this skill.
SkillAFreshness: A★ 4Claude Code +9 - 0.603score
idea-status
eiei114
Read-only Operations Cockpit for Idea Sessions.
SkillAFreshness: A★ 4Claude Code +9 - 0.589score
template-skill-bridge
eiei114
Template skill contributed by extensions/skill-bridge via resources_discover.
SkillAFreshness: A★ 2Claude Code +9 - 0.581score
spotify-playback
eiei114
Control Spotify playback and share now playing to X from Pi.
SkillAFreshness: A★ 1Claude Code +9 - 0.561score
example-skill
eiei114
Example Agent Skill shipped by this Pi package template.
SkillAFreshness: A★ 2Claude Code +9
Cite this page
java-junit skill. Agent Mart. https://agentmart.dev/skills/eiei114-java-junit (last updated 2026-10-24)