New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Parameterized JUnit 5 test patterns that run one test body across many inputs from annotated data sources.

skills.sh installs
4K
GitHub stars
372
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers @ValueSource, @CsvSource, @MethodSource, @EnumSource, and @ArgumentsSource with custom display names for readable output
  • Provides Java examples for simple values, tabular data, complex objects, enum coverage, and custom argument providers
  • Includes boundary-value patterns such as Integer.MIN_VALUE and Integer.MAX_VALUE, plus error-condition tests for null and blank input
  • Designed for Java projects using Maven or Gradle that need data-driven tests, with CSV quoting and static factory rules noted

Install

$ npx -y skills add giuseppe-trisciuoglio/developer-kit --skill unit-test-parameterized -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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
  5. Validate: Run ./gradlew test --info or mvn test and verify all parameter combinations execute

Examples

Maven / Gradle Dependency

JUnit 5 parameterized tests require junit-jupiter (includes params). Add assertj-core for assertions:

Details

Repository
github.com/giuseppe-trisciuoglio/developer-kit
Categories
Testing & QA, Java & JVM
First seen
May 16, 2026

More from giuseppe-trisciuoglio/developer-kit

All 95

Similar to Unit Test Parameterized

More Testing & QA