I have multimodule gradle project each of which contains a number of tests. For each module before running all tests I'd like to perform static
fields and other configuration initialization so the tests will be run using this set up. Here is what I mean:
public class MyJUnitConfig{
static {
SomeClass.someStaticIntField = 5;
//...
}
}
The problem is the class won't be initialized and therefore the static
initializer won't be called if the class is not used explicitly.
Is there some JUNit (or probably other) annotation to cause class to be initialized upon JVM startup so all the JUnit tests run with the static
configuration set up in the MyJUnitConfig
static initializer?