unit-test-parameterized
SolidProvides parameterized testing patterns with JUnit 5, generates data-driven unit tests using @ParameterizedTest, @ValueSource, @CsvSource, @MethodSource. Creates tests that run the same logic with multiple input values. Use when writing data-driven Java tests, multiple test cases from single method, or boundary value analysis.
Testing & QA 278 stars
32 forks Updated 5 days ago MIT
Install
Quality Score: 91/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# 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:
```xml
<!-- Maven -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
```
```kotlin
// Gradle
testImplementation("org.junit.jupiter:junit-jupiter")
```
### `@ValueSource` — Simple Values
```java
import org.junit.jupite...
Details
- Author
- giuseppe-trisciuoglio
- Repository
- giuseppe-trisciuoglio/developer-kit
- Created
- 7 months ago
- Last Updated
- 5 days ago
- Language
- Python
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Solid
java-junit
Get best practices for JUnit 5 unit testing, including data-driven tests
34,887 Updated today
github AI & Automation Listed
java-junit
JUnit 5 testing patterns and parameterized-test guidance. Use when writing or reviewing Java unit tests.
1 Updated today
bg-szy Testing & QA Solid
kotlin-testing
Kotlin testing with JUnit 5, Kotest, and coroutine dispatchers.
393 Updated today
notque