My JUnit tests require three environment variables to be set. It is infuriating to have to set these for each new test class.
How can I avoid this?
Select Run
> Edit Configurations...
then on the bottom-left of the dialog click Edit Configuration Templates
in the left pane select JUnit
then in the right use Environment Variables:
to add your environment variables. Click Apply
or OK
. From now on, those variables will be added to every new JUnit run configuration in your project.
Top Tip
If you click the Edit environment variables
, you can paste multiple env variables at once like this:
FOO=bar
BAR=foo