Skip to main content
Parameterized tests let you run the same test method multiple times with different arguments. Instead of duplicating test methods for each input, declare the values once and let HRTK iterate over them.

Basic Usage

Annotate your method with @ParameterizedTest and provide values via @ValueSource. The first parameter of your method receives each value in turn.
This generates five test executions, each reported separately in the output:

Supported Value Types

@ValueSource supports six primitive array types. Set exactly one array field per annotation.

Combining with Context Injection

The parameterized value is always the first parameter. Additional parameters are injected by HRTK as usual.
The parameterized value must be the first parameter in the method signature. Context types (TestContext, WorldTestContext, etc.) must come after.

How Results Are Reported

Each parameter value produces a separate TestResult with a display name that includes the index and value:
For example:
If --fail-fast is set and one parameterized invocation fails, the remaining values are skipped.

Practical Example: Tier Damage Scaling

Next Steps