junit Paramaterizing Tests


Sometimes you have a test you need to run multiple times, each time with different data. Parameterizing the test allows you to do this in an easy and maintainable way.


  • @RunWith(Parameterized.class) //annotation for test class

    @Parameters//annotation for data


One benefit to using parameters is that if one set of data fails, execution will just move to the next set of data instead of stopping the whole test.