From 8b58626800cebc5c9363c3ccd1d863358b966dab Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Fri, 4 Nov 2022 16:50:18 +1300 Subject: [PATCH] Refactor rename internal method loadFileWithExtensionCheck() -> loadWithExtensionCheck() --- src/main/java/io/avaje/config/InitialLoader.java | 6 +++--- src/test/java/io/avaje/config/InitialLoaderTest.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/avaje/config/InitialLoader.java b/src/main/java/io/avaje/config/InitialLoader.java index 93ae52b..bad5ec0 100644 --- a/src/main/java/io/avaje/config/InitialLoader.java +++ b/src/main/java/io/avaje/config/InitialLoader.java @@ -201,7 +201,7 @@ private void loadViaIndirection() { private void loadViaPaths(String paths) { for (String path : splitPaths(paths)) { - loadFileWithExtensionCheck(loadContext.eval(path)); + loadWithExtensionCheck(loadContext.eval(path)); } } @@ -230,14 +230,14 @@ private void loadViaSystemProperty() { if (fileName == null) { fileName = System.getProperty("props.file"); if (fileName != null) { - if (!loadFileWithExtensionCheck(fileName)) { + if (!loadWithExtensionCheck(fileName)) { Config.log.log(Level.WARNING, "Unable to find file {0} to load properties", fileName); } } } } - boolean loadFileWithExtensionCheck(String fileName) { + boolean loadWithExtensionCheck(String fileName) { if (fileName.endsWith("yaml") || fileName.endsWith("yml")) { return loadYaml(fileName, RESOURCE) || loadYaml(fileName, FILE); } else if (fileName.endsWith("properties")) { diff --git a/src/test/java/io/avaje/config/InitialLoaderTest.java b/src/test/java/io/avaje/config/InitialLoaderTest.java index 49fe77a..c388917 100644 --- a/src/test/java/io/avaje/config/InitialLoaderTest.java +++ b/src/test/java/io/avaje/config/InitialLoaderTest.java @@ -38,9 +38,9 @@ void load() { @Test void loadWithExtensionCheck() { InitialLoader loader = new InitialLoader(); - loader.loadFileWithExtensionCheck("test-dummy.properties"); - loader.loadFileWithExtensionCheck("test-dummy.yml"); - loader.loadFileWithExtensionCheck("test-dummy2.yaml"); + loader.loadWithExtensionCheck("test-dummy.properties"); + loader.loadWithExtensionCheck("test-dummy.yml"); + loader.loadWithExtensionCheck("test-dummy2.yaml"); Properties properties = loader.eval(); assertThat(properties.getProperty("dummy.yaml.bar")).isEqualTo("baz");