From Napkin
Provides JUnit 5 best practices for writing unit tests, including parameterized tests, assertions, mocking, and test organization.
How this skill is triggered — by the user, by Claude, or both
Slash command
/napkin:java-junitThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Your goal is to help me write effective unit tests with JUnit 5, covering both standard and data-driven testing approaches.
Your goal is to help me write effective unit tests with JUnit 5, covering both standard and data-driven testing approaches.
src/test/java.junit-jupiter-api, junit-jupiter-engine, and junit-jupiter-params for parameterized tests.mvn test or gradle test.Test suffix, e.g., CalculatorTest for a Calculator class.@Test for test methods.methodName_should_expectedBehavior_when_scenario.@BeforeEach and @AfterEach for per-test setup and teardown.@BeforeAll and @AfterAll for per-class setup and teardown (must be static methods).@DisplayName to provide a human-readable name for test classes and methods.@ParameterizedTest to mark a method as a parameterized test.@ValueSource for simple literal values (strings, ints, etc.).@MethodSource to refer to a factory method that provides test arguments as a Stream, Collection, etc.@CsvSource for inline comma-separated values.@CsvFileSource to use a CSV file from the classpath.@EnumSource to use enum constants.org.junit.jupiter.api.Assertions (e.g., assertEquals, assertTrue, assertNotNull).assertThat(...).is...).assertThrows or assertDoesNotThrow to test for exceptions.assertAll to ensure all assertions are checked before the test fails.@Mock and @InjectMocks annotations from Mockito to simplify mock creation and injection.@Tag to categorize tests (e.g., @Tag("fast"), @Tag("integration")).@TestMethodOrder(MethodOrderer.OrderAnnotation.class) and @Order to control test execution order when strictly necessary.@Disabled to temporarily skip a test method or class, providing a reason.@Nested to group tests in a nested inner class for better organization and structure.npx claudepluginhub ani1797/forge --plugin copilot-sdk2plugins reuse this skill
First indexed Jun 6, 2026
Covers JUnit fundamentals including annotations, assertions, test lifecycle, setup, configuration, and best practices for Java unit testing.
Generates production-grade JUnit 5 unit and integration tests in Java with assertions, parameterized tests, lifecycle hooks, Mockito mocking, and nested tests.
Generates JUnit 5 unit tests with Mockito and Testcontainers integration tests for Java services, repositories, controllers, and utilities. Auto-detects Maven/Gradle/Spring Boot setup from build files.