### Question:
ServerInfoCollector { void storeServerConfiguration(File outputDir) { try { System.out.print("Getting Configuration..."); final Map<String, String> serverConfigMap = client.getServerConfiguration(); final Configuration serverConfig = new Configuration(false); for (Map.Entry<String, String> ent : serverConfigMap.entrySet()) { serverConfig.set(ent.getKey(), ent.getValue()); } try (OutputStream outputStream = new FileOutputStream( new File(outputDir, "effective-oozie-site.xml"))) { serverConfig.writeXml(outputStream); } System.out.println("Done"); } catch (OozieClientException | IOException e) { System.err.printf("Exception occurred during the retrieval of effective Oozie server configuration " + "\"oozie-site.xml\": %s%n", e.getMessage()); } } ServerInfoCollector(final DiagOozieClient client);   }### Answer:
@Test public void testGetServerConfiguration() throws Exception { final Map<String, String> testSysProps = new HashMap<>(); testSysProps.put("oozie.services", "org.apache.oozie.service.SchedulerService"); doReturn(testSysProps).when(mockDiagClient).getServerConfiguration(); serverInfoCollector.storeServerConfiguration(testTempFolder); final File shareLibOut = new File(testTempFolder, "effective-oozie-site.xml"); assertTrue(shareLibOut.exists()); assertFileContains(shareLibOut, "SchedulerService"); }