I have a scenario where I'm trying to disable parameterized tests but I don't want to disable all of them. Consider the below mock scenario
@CsvSource({
"1,1",
"2,2",
"3,not3"
})
@ExtendWith(DisableParameterized.class)
@ParameterizedTest( name = "Test for {0} is equal to {1}")
void equality(String expected, String actual) {
assertEquals(expected, actual, "Not as expected");
}
Is it possible to write a DisableParameterized implements ExecutionCondition
which can disable one of the Parameterized tests basis some meta data.
The only proper info I can make out about ParameterizedTests in the
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext extensionContext)
is the displayName
Is there some other way to generically provide some sort of meta data to disable the Parameterized tests ?
if I mark them as @Disabled, it disables all of the ParameterizedTests to the point that it doesn't even invoke the individual tests and stops at the method level.
Edit : As mentioned by Sam below, it's not possible to do it using standard API till the issues mentioned are fixed/implemented and release in a newer version. I was however able to write a code using reflection to achieve what I wanted, so I've added an answer below