@DataPoint
that are not public
and/or not static
.
A theories test class with a malformed @DataPoint
member
cannot be run.
For example:
@RunWith(Theories.class)
public class SeriousTest {
@DataPoint
private String dataPoint = "value";
@DataPoint("generated")
private String generatedDataPoint() {
return "generated value";
}
@Theory
public void theoryMethod(String param) {
// ...
}
}
A quick fix is provided to fix the modifiers:
@RunWith(Theories.class)
public class SeriousTest {
@DataPoint
public static String dataPoint = "value";
@DataPoint("generated")
public static String generatedDataPoint() {
return "generated value";
}
@Theory
public void theoryMethod(String param) {
// ...
}
}