Reputation: 49
I run parametrized test with Junit, but I want to skip some tests following a flag. The parameters are stored in a CSV file and when a flag is "off" I want to skip this test. How can I do this?
Upvotes: 0
Views: 1247
Reputation: 24540
You can use the Assume class.
@Test
public void something() throws Exception {
Assume.assumeFalse(valueFromCsv.equals("off"));
}
The test will be skipped by JUnit if the assumption is not fulfilled.
Upvotes: 3