Feature requests
1. @WithNullParam
Like @WithBooleanParams but injects null alongside a provided value. Useful for null-safety testing.
@Test
@WithNullParam("hello")
public void handlesNull() {
String value = params.get(); // runs twice: "hello", then null
}
2. @WithEnumParams(MyEnum.class)
Auto-iterate all enum values without listing them as strings.
@Test
@WithEnumParams(Color.class)
public void testAllColors() {
Color color = params.asEnum(Color.class);
}
3. @WithParamsSource("methodName")
Like JUnit 5's @MethodSource — reference a method that returns parameter sets. Avoids huge annotation arrays.
@Test
@WithParamsSource("provideNumbers")
public void sum() {
int n1 = params.asInt("n1");
int n2 = params.asInt("n2");
assertEquals(params.asInt("result"), calculator.sum(n1, n2));
}
static String[][] provideNumbers() {
return new String[][] { {"1", "2", "3"}, {"11", "-2", "9"} };
}
4. asEnum(MyEnum.class) accessor
Type-safe enum accessor to complement asInt(), asFloat(), etc.
Color color = params.asEnum(Color.class);
Color color = params.asEnum("colorParam", Color.class);
Requirements
Each feature must include comprehensive unit tests covering all possible combinations:
- Happy path (single and named parameters)
- Error/edge cases (invalid values, missing parameters, wrong types)
- Integration tests using
@Rule with the full annotation lifecycle (similar to WithBooleanParamsTest)
- Accessor tests with and without named parameters, including exception cases (similar to existing patterns in
WithParamsRuleTest)
Feature requests
1.
@WithNullParamLike
@WithBooleanParamsbut injectsnullalongside a provided value. Useful for null-safety testing.2.
@WithEnumParams(MyEnum.class)Auto-iterate all enum values without listing them as strings.
3.
@WithParamsSource("methodName")Like JUnit 5's
@MethodSource— reference a method that returns parameter sets. Avoids huge annotation arrays.4.
asEnum(MyEnum.class)accessorType-safe enum accessor to complement
asInt(),asFloat(), etc.Requirements
Each feature must include comprehensive unit tests covering all possible combinations:
@Rulewith the full annotation lifecycle (similar toWithBooleanParamsTest)WithParamsRuleTest)