How are environment variables set in Corda mocknetwork tests?

My original response here was the following:

You can still system.out.println within your tests / cordapps so I believe you can also do things like environment variables too:

Amol ended up working it out in the following way :

I ended up using this library which does it quite cleanly (and extends JUnit 5)