From a9236e3acbc697896b0557f5c45a4dbec06508bc Mon Sep 17 00:00:00 2001 From: Keith Lustria Date: Fri, 20 May 2022 06:17:53 -0700 Subject: [PATCH] Various updates/cleanups from review feedback --- .../helidon/config/mp/MpMetaConfigTest.java | 15 ------------ .../test/resources/custom-application.conf | 24 ------------------- .../test/resources/custom-application.json | 10 -------- .../hocon/mp/HoconMpConfigIncluder.java | 6 ++--- 4 files changed, 3 insertions(+), 52 deletions(-) delete mode 100644 config/config-mp/src/test/resources/custom-application.conf delete mode 100644 config/config-mp/src/test/resources/custom-application.json diff --git a/config/config-mp/src/test/java/io/helidon/config/mp/MpMetaConfigTest.java b/config/config-mp/src/test/java/io/helidon/config/mp/MpMetaConfigTest.java index 9628915a6dc..c55697e9fcd 100644 --- a/config/config-mp/src/test/java/io/helidon/config/mp/MpMetaConfigTest.java +++ b/config/config-mp/src/test/java/io/helidon/config/mp/MpMetaConfigTest.java @@ -60,21 +60,6 @@ void resetConfig() { } } - // @Test - void testMetaYaml() { - System.setProperty(MpMetaConfig.META_CONFIG_SYSTEM_PROPERTY, "custom-mp-meta-config.yaml"); - config = ConfigProvider.getConfig(); - - // validate the config sources - Iterable configSources = config.getConfigSources(); - List sourceNames = new LinkedList<>(); - configSources.forEach(it -> sourceNames.add(it.getName())); - - assertThat(sourceNames, iterableWithSize(2)); - assertThat(sourceNames.get(0), is("CLASSPATH")); - assertThat(config.getValue("value", String.class), is("classpath")); - } - @Test void testMetaEnvironmentVariablesSystemProperties() { System.setProperty("property1", "value1"); diff --git a/config/config-mp/src/test/resources/custom-application.conf b/config/config-mp/src/test/resources/custom-application.conf deleted file mode 100644 index f432b18920d..00000000000 --- a/config/config-mp/src/test/resources/custom-application.conf +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (c) 2022 Oracle and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -string = String -number = 175 -array = [ - One - Two - Three -] -boolean = true diff --git a/config/config-mp/src/test/resources/custom-application.json b/config/config-mp/src/test/resources/custom-application.json deleted file mode 100644 index 08cb127271e..00000000000 --- a/config/config-mp/src/test/resources/custom-application.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "string": "String", - "number": 175, - "array": [ - "One", - "Two", - "Three" - ], - "boolean": true -} diff --git a/config/hocon-mp/src/main/java/io/helidon/config/hocon/mp/HoconMpConfigIncluder.java b/config/hocon-mp/src/main/java/io/helidon/config/hocon/mp/HoconMpConfigIncluder.java index f38e557008f..efde0b25d11 100644 --- a/config/hocon-mp/src/main/java/io/helidon/config/hocon/mp/HoconMpConfigIncluder.java +++ b/config/hocon-mp/src/main/java/io/helidon/config/hocon/mp/HoconMpConfigIncluder.java @@ -122,11 +122,11 @@ void relativePath(Path relativePath) { * @param what file name * @return file name with extension */ - public static String patchName(String what) { - java.util.Optional base = java.util.Optional.of(what) + private static String patchName(String what) { + Optional base = Optional.of(what) .filter(f -> f.contains(File.separator)) .map(f -> f.substring(f.lastIndexOf(File.separator) + 1)); - java.util.Optional ext = Optional.of(base.orElse(what)) + Optional ext = Optional.of(base.orElse(what)) .filter(f -> f.contains(".")) .map(f -> f.substring(f.lastIndexOf(".") + 1)); return ext.isPresent() ? what : what + HOCON_EXTENSION;