### Question:
ConfigLoader { public static StreamflowConfig getConfig() { String yamlConfig = null; File yamlConfigFile = new File(StreamflowEnvironment.getConfDir(), "streamflow.yml"); if (yamlConfigFile.exists()) { try { yamlConfig = FileUtils.readFileToString(yamlConfigFile, "UTF-8"); LOG.info("Using user provided streamflow.yml: " + yamlConfigFile.getAbsolutePath()); } catch (Exception ex) { } } if (yamlConfig == null) { try { yamlConfig = IOUtils.toString(Thread.currentThread().getContextClassLoader(). getResourceAsStream("streamflow.yml"), "UTF-8"); LOG.info("Using classpath provided streamflow.yml"); } catch (Exception ex) { } } if (yamlConfig == null) { LOG.info("streamflow.yml not found anywhere... using default configuration"); return new StreamflowConfig(); } else { ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory()); try { return objectMapper.readValue(yamlConfig, StreamflowConfig.class); } catch (Exception ex) { LOG.error("Unable to parse provided streamflow.yml configuration. " + "Using default values: ", ex); return new StreamflowConfig(); } } }  static StreamflowConfig getConfig(); static Logger LOG; }### Answer:
@Test public void verfifyStreamflowHomeProvidedConfig() throws IOException { StreamflowEnvironment.setStreamflowHome(tempFolder.getRoot().getAbsolutePath()); StreamflowEnvironment.initialize(); ProxyConfig mockedProxy = new ProxyConfig(); mockedProxy.setHost("testHost"); mockedProxy.setPort(7777); StreamflowConfig mockedConfig = new StreamflowConfig(); mockedConfig.setProxy(mockedProxy); FileUtils.writeStringToFile(new File(StreamflowEnvironment.getConfDir(), "streamflow.yml"), mapper.writeValueAsString(mockedConfig)); StreamflowConfig loadedConfig = ConfigLoader.getConfig(); assertEquals("streamflow home config should match ConfigLoader streamflow config", mockedConfig, loadedConfig); }
@Test public void verifyClasspathProvidedConfig() throws IOException { StreamflowEnvironment.setStreamflowHome(tempFolder.getRoot().getAbsolutePath()); StreamflowEnvironment.initialize(); String yamlConfig = IOUtils.toString(Thread.currentThread().getContextClassLoader(). getResourceAsStream("streamflow.yml"), "UTF-8"); StreamflowConfig classpathConfig = mapper.readValue(yamlConfig, StreamflowConfig.class); StreamflowConfig loadedConfig = ConfigLoader.getConfig(); assertEquals("Classpath streamflow config should match ConfigLoader streamflow config", classpathConfig, loadedConfig); }