在下面的代码中,我想TestMethod1
用标有的参数运行@Parameters
@RunWith(Parameterized.class)
public class Foo{
private boolean input;
private boolean expected;
public Foo(boolean input, boolean expected{
this.input=input;
this.expected=expected;
}
@Parameters
public static List<Object[]> data() {
return Arrays.asList(new Object[][]{{false, false}, {false, false}});
}
@Test
public void TestMethod1(){
assertEquals(expected, Baar.StaticMethod(input);
}
@Test
public void TestMethod2(){
assertEquals(expected, Baar.StaticMethod2(false);
}
问题是当我运行 junittes 时,TestMethod1 和 TestMethod2 方法都使用这些参数运行。如何告诉测试运行者只运行带有@Parameters 标记的参数的TestMethod1?