### Question:
EcLogYamlConfigLoader { static EcLogYamlConfig loadConfigFromUrl(Path filePath) { Constructor constructor = new Constructor(EcLogYamlConfig.class); Yaml yaml = new Yaml(constructor); try { String fileAsString = new String(Files.readAllBytes(filePath)); EcLogYamlConfig auditYamlConfig = (EcLogYamlConfig) yaml.load(fileAsString); return auditYamlConfig == null ? new EcLogYamlConfig() : auditYamlConfig; } catch (YAMLException | IOException e) { throw new IllegalArgumentException("Invalid configuration file: " + filePath, e); } } private  EcLogYamlConfigLoader(); static EcLogYamlConfig load(ToolOptions options);  }### Answer:
@Test public void testLoadEmptyConfigFromUrlGivesDefaultConfig() { Path path = Paths.get("src/test/resources/empty.yaml"); EcLogYamlConfig config = EcLogYamlConfigLoader.loadConfigFromUrl(path); assertDefaultConfig(config); }
@Test public void testLoadConfigFromFileWithInvalidContent() { Path path = Paths.get("src/test/resources/invalid.yaml"); assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> EcLogYamlConfigLoader.loadConfigFromUrl(path)) .withMessage("Invalid configuration file: src/test/resources/invalid.yaml"); }