unit-test-parameterized

Installation
Summary

JUnit 5 parameterized testing patterns for running single test methods with multiple input combinations.

  • Supports multiple data sources: @ValueSource for simple values, @CsvSource for tabular data, @MethodSource for complex objects, @EnumSource for enum testing, and custom ArgumentsProvider implementations
  • Includes boundary value testing, edge case coverage, and systematic validation of multiple scenarios with reduced test duplication
  • Offers custom display names for readable test output and @RepeatedTest for concurrent or flaky test detection
  • Requires junit-jupiter-params dependency on test classpath; parameter count and types must match test method signature
SKILL.md

Parameterized Unit Tests with JUnit 5

Overview

Provides patterns for parameterized unit tests in Java using JUnit 5. Covers @ValueSource, @CsvSource, @MethodSource, @EnumSource, @ArgumentsSource, and custom display names. Reduces test duplication by running the same test logic with multiple input values.

When to Use

  • Writing JUnit tests with multiple input combinations
  • Implementing data-driven tests in Java
  • Running same test with different values (boundary analysis)
  • Testing multiple scenarios from single test method

Instructions

  1. Add dependency: Ensure junit-jupiter-params is on test classpath (included in junit-jupiter)
  2. Choose source: @ValueSource for simple values, @CsvSource for tabular data, @MethodSource for complex objects
  3. Match parameters: Test method parameters must match data source types
  4. Set display names: Use name = "{0}..." for readable output
Related skills

More from giuseppe-trisciuoglio/developer-kit

Installs
871
GitHub Stars
246
First Seen
Feb 3, 2026