I would recommend not using alwaysRun = true, but creating a special group for config methods (we use "config") and annotating everything before * () and after * () methods with groups = "config".
All testing methods can be annotated with any group that you like, for example. "foo" and "bar".
Then in your run you do:
-Dgroups=config,foo
or
-Dgroups=config,bar
If you add another group "newGroup", you do not need to go through all the configuration methods and add "newGroup" to them, you just run:
-Dgroups=config,newGroup
This simplifies group management.
If you (by mistake?) Run something like:
-Dgroups=config,nonExistingGroup
No tests (and no configuration methods) will be executed, since you actually do not have any tests annotated for the "nonExistingGroup", and the configuration methods are only executed if there are "corresponding tests" that require these configuration methods.
mac
source share