title: Having trouble mocking System.getenv calls in junit
body: <p>I'm trying to write a unit test with junit and mockito (very new to this) for a Spring Boot application. Basically in my code, I have specified an environment variable for a specific URL in a manifest.yml file (for deployment) that I can access through <code>String URL = System.getenv("VARIABLE")</code> in my code. I'm having a lot of trouble with my unit testing however, since the <code>URL</code> variable is obviously undefined. I tried the solution <a href="https://stackoverflow.com/questions/8168884/how-to-test-code-dependent-on-environment-variables-using-junit/8169008">here</a>, but realized this is only for mocking an environment variable if you're calling it from the actual test itself, not if you're relying on the environment variable being accessible from the code.</p>
  
  <p>Is there any way to set it up so that when the test is run, I can set environment variables that can be accessed within the code?</p>