@RunWith(Parameterized.class)
アノテーションが付いているものの、@Parameterized.Parameters
アノテーションが付いたデータプロバイダーメソッドを含んでいないか、当該メソッドに正しいシグネチャーがない JUnit 4 パラメーター化テストクラスを報告します。 このようなテストクラスは実行できません。
データプロバイダーメソッドは public
で static
、かつ戻り値の型が Iterable
または Object[]
である必要があります。
空パラメーターのプロバイダーメソッドを作成するか、不正なデータプロバイダーメソッドのシグネチャーを変更することを提案します。
例:
@RunWith(Parameterized.class)
public class ImportantTest {
private int input;
private int expected;
ImportantTest(int input, int expected) {
this.input = input;
this.expected = expected;
}
// ... test cases
}
クイックフィックス適用後:
@RunWith(Parameterized.class)
public class ImportantTest {
private int input;
private int expected;
ImportantTest(int input, int expected) {
this.input = input;
this.expected = expected;
}
@Parameters
public static Iterable<Object[]> parameters() {
return null;
}
// ... test cases
}