Assuming, i want use a predefined static final list instance(s) as a holder of some "configuration" for a test. This is a list, so i use static {} block where some values are added to the instances:
public class Config{
...
public static final List<Object[]> config = new ArrayList<>();
static{
//object[] are always pairs her`e
config.add(new Object[] { ... whatever});
config.add(new Object[] { ... whatever});
config.add(new Object[] { ... whatever});
}
}
...
//then the test class:
@RunWith(Parameterized.class)
public class GeneralTemplate{
...
@Parameters(name = "{index}: source: {0} target: {1}")
public static Collection<Object[]> config() {
return Config.config;
}
}
I will use then this instances in the JUnit test class. I guess, because of this definitions + annotations the test runs with the mistake "no tests have been found"?