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?
From the main menu, select Run | Edit Configurations or choose Edit Configurations from the run/debug configurations selector on the toolbar. In the Run/Debug Configurations dialog, select a configuration you want to add the environment variables to. Type the variable name and value: <name>=<value> .
Click edit configurations on the dropdown box for your runtime configurations. Select the runtime you want to add environment variables to. Click environment variables folder icon to pull up the environment variables screen.
Select Run > Edit Configurations...
, open the Defaults
(Templates
since IDEA 2020) node in the left tree and select JUnit
. Now add your environment variables in the main panel and click Apply
or OK
. From now on, those variables will be added to every new JUnit run configuration in your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With