Using Parameterized.Parameter in junit 4.13

363 Views Asked by At

I am getting a "cannot resolve symbol Parameter" in the impor. I have to use using junit 4.13, I think this code would work in junit 4.12. What changes can I make to get the following code to work?

import org.junit.Test;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;

@RunWith(Parameterized.class)
public class MyTest {

    @Parameterized.Parameter(0)
    private String arg1;

    @Parameterized.Parameter(1)
    private long arg2;

    public  MyTest(String arg1, long arg2) {
        this.arg1 = arg1;
        this.arg2 = arg2;
    }

    @Parameterized.Parameters
    public static Collection argPairs() {
        return Arrays.asList(new Object[][] {
                {"using arg1", Long.parseLong(arg1) },
                {"using arg2", Long.parseLong(arg2) }
        });
    }

    @Test
    public void test1() {
        // stuff
    }
}

0

There are 0 best solutions below