unit-test-parameterized

Execute JUnit 5 parameterized tests on Java methods with multiple input sources.

322|37|Updated Oct 21, 2025
One-click install
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill unit-test-parameterized
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unit-test-parameterized
Source: https://github.com/giuseppe-trisciuoglio/developer-kit/tree/main/skills/junit-test/unit-test-parameterized
Command: npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill unit-test-parameterized

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Parameterized testing with JUnit 5 allows a single test method to run against multiple inputs, increasing coverage and reducing duplication.

Core Features & Use Cases

  • @ParameterizedTest: @ValueSource, @CsvSource, @MethodSource data sources.
  • Data-driven testing: Systematically cover valid/invalid inputs and boundaries.
  • Cleaner tests: Reduce duplication while increasing coverage.

Quick Start

Add junit-jupiter and assertj dependencies; annotate tests with @ParameterizedTest and supply sources like @ValueSource, @CsvSource, or @MethodSource.

Frequently Asked Questions about unit-test-parameterized

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run the same test with multiple inputs in JUnit 5?

Parameterized tests in JUnit 5 let a single test method execute against multiple input sets using @ParameterizedTest and data sources like @ValueSource, @CsvSource, or @MethodSource. This reduces duplication while covering valid, boundary, and invalid cases systematically.

What's the difference between @ValueSource, @CsvSource, and @MethodSource in JUnit 5?

@ValueSource supplies a single array of literals; @CsvSource provides comma-separated rows of multiple parameters; @MethodSource references a method returning a stream of arguments. Choose based on data complexity and reusability needs.

Can I use parameterized tests with Maven and Gradle?

Yes. Add junit-jupiter dependencies to Maven or Gradle, then annotate test methods with @ParameterizedTest and supply data sources. Both build tools integrate JUnit 5 seamlessly for parameterized test execution.

How do parameterized tests reduce test duplication?

Instead of writing separate test methods for each input, parameterized tests run identical assertions across multiple datasets in one method. This cuts code repetition while maintaining full coverage of valid, boundary, and invalid inputs.

Do parameterized tests work with assertion libraries like AssertJ?

Yes. Parameterized tests execute standard assertions per iteration, so AssertJ and other libraries work without modification. Each parameter set runs the same assertion logic independently.