131-java-testing-unit-testing
CommunityModernize Java unit tests with JUnit 5.
System Documentation
What problem does it solve?
Use when you need to review, improve, or write Java unit tests — including migrating from JUnit 4 to JUnit 5, adopting AssertJ for fluent assertions, structuring tests with Given-When-Then, ensuring test independence, applying parameterized tests, mocking dependencies with Mockito, verifying boundary conditions (RIGHT-BICEP, CORRECT, A-TRIP), leveraging JSpecify null-safety annotations, or eliminating testing anti-patterns such as reflection-based tests or shared mutable state. Part of the skills-for-java project
Core Features & Use Cases
- Migrate from JUnit 4 to JUnit 5 with Jupiter extensions and modern annotations
- Adopt AssertJ for fluent assertions and Mockito for mocking
- Apply Given-When-Then structure, parameterized tests, and boundary-condition checks (RIGHT-BICEP, CORRECT, A-TRIP)
- Target Java unit testing guidelines across typical enterprise projects
- Use in real-world projects to improve test clarity, stability, and maintainability
Quick Start
Migrate existing tests from JUnit 4 to JUnit 5 and begin using AssertJ and Mockito in your test suite.
Dependency Matrix
Required Modules
None requiredComponents
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: 131-java-testing-unit-testing Download link: https://github.com/jabrena/cursor-rules-java/archive/main.zip#131-java-testing-unit-testing Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.