### Question:
ServerInfoCollector { void storeOsEnv(final File outputDir) { try { System.out.print("Getting OS Environment Variables..."); final Map<String, String> osEnv = client.getOSEnv(); try (DiagBundleEntryWriter configEntryWriter = new DiagBundleEntryWriter(outputDir,"os-env-vars.txt")) { for (Map.Entry<String, String> ent : osEnv.entrySet()) { configEntryWriter.writeStringValue(ent.getKey() + " : ", ent.getValue()); } } System.out.println("Done"); } catch (OozieClientException | IOException e) { System.err.printf("Exception occurred during the retrieval of environment variable settings for the Oozie server:%s%n", e.getMessage()); } } ServerInfoCollector(final DiagOozieClient client);   }### Answer:
@Test public void testGetOsEnv() throws Exception { Map<String, String> testSysProps = new HashMap<>(); testSysProps.put("JETTY_OUT", "jetty.out"); doReturn(testSysProps).when(mockDiagClient).getOSEnv(); serverInfoCollector.storeOsEnv(testTempFolder); final File shareLibOut = new File(testTempFolder, "os-env-vars.txt"); assertTrue(shareLibOut.exists()); assertFileContains(shareLibOut, "JETTY_OUT"); }