JUnitParams for each method of class

Viewed 718

Is it possible to run parameterized test for each method of test class with JUnitParams and class level annotations? Something like:

@RunWith(JUnitParamsRunner.class)
@Parameters(method = "paramsGenerator")
public class TestMethod {

    public Integer[] paramsGenerator() {
        return new Integer[] {1, 2, 3};
    }

    @Test
    public void test1(Integer myInt) {
        ......
    }

    @Test
    public void test2(Integer myInt) {
        ......
    }
}
2 Answers
Related