From 8cf4b0228c3412cb123f6c462877703b5cb73485 Mon Sep 17 00:00:00 2001
From: Keith Lustria <34235093+klustria@users.noreply.github.com>
Date: Tue, 14 Jun 2022 14:10:23 -0700
Subject: [PATCH] Add helidon-config-yaml-mp as a dependency in
helidon-microprofile-config. (#4379)
helidon-config-yaml-mp was recently decoupled from helidon-config-mp which is part of helidon-microprofile-config and as a consequence, is not a part of that config bundle anymore. This work was done to add it back and avoid any effects of incompatibility.
(cherry picked from commit aca9bf76f046fd94f292c8a6d61ae79c65f72031)
---
microprofile/config/pom.xml | 4 ++
tests/integration/config/gh-4375/pom.xml | 46 +++++++++++++++++++
.../integration/gh4375/YamlMpConfigTest.java | 39 ++++++++++++++++
.../src/test/resources/application.yaml | 17 +++++++
tests/integration/config/hocon-mp/pom.xml | 10 ----
.../hocon/mp/HoconJsonMpMetaConfigTest.java | 2 +-
6 files changed, 107 insertions(+), 11 deletions(-)
create mode 100644 tests/integration/config/gh-4375/pom.xml
create mode 100644 tests/integration/config/gh-4375/src/test/java/io/helidon/tests/integration/gh4375/YamlMpConfigTest.java
create mode 100644 tests/integration/config/gh-4375/src/test/resources/application.yaml
diff --git a/microprofile/config/pom.xml b/microprofile/config/pom.xml
index e5835152b49..760fa6445c4 100644
--- a/microprofile/config/pom.xml
+++ b/microprofile/config/pom.xml
@@ -39,6 +39,10 @@
io.helidon.config
helidon-config-mp
+
+ io.helidon.config
+ helidon-config-yaml-mp
+
io.helidon.config
helidon-config-yaml
diff --git a/tests/integration/config/gh-4375/pom.xml b/tests/integration/config/gh-4375/pom.xml
new file mode 100644
index 00000000000..1da3b4e0bd1
--- /dev/null
+++ b/tests/integration/config/gh-4375/pom.xml
@@ -0,0 +1,46 @@
+
+
+
+
+ 4.0.0
+
+ io.helidon.tests.integration
+ helidon-tests-integration-config
+ 3.0.0-SNAPSHOT
+
+
+ helidon-tests-integration-config-gh-4375
+ Helidon Tests Integration GH 4375
+ Validation for Github issue #4375 - Verify that helidon-config-yaml-mp is part of helidon-microprofile-config
+
+
+
+ io.helidon.microprofile.config
+ helidon-microprofile-config
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ test
+
+
+
diff --git a/tests/integration/config/gh-4375/src/test/java/io/helidon/tests/integration/gh4375/YamlMpConfigTest.java b/tests/integration/config/gh-4375/src/test/java/io/helidon/tests/integration/gh4375/YamlMpConfigTest.java
new file mode 100644
index 00000000000..2740c3898a1
--- /dev/null
+++ b/tests/integration/config/gh-4375/src/test/java/io/helidon/tests/integration/gh4375/YamlMpConfigTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+package io.helidon.tests.integration.gh4375;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.ConfigProvider;
+
+class YamlMpConfigTest {
+ private Config config;
+
+ @BeforeEach
+ void initialize() {
+ this.config = ConfigProvider.getConfig();
+ Assertions.assertNotNull(this.config);
+ }
+
+ @Test
+ void TestYamlMpConfigExistsInMicroprofileConfig() {
+ Assertions.assertTrue(this.config.getValue("yamlMpConfigExists", Boolean.class));
+ }
+}
diff --git a/tests/integration/config/gh-4375/src/test/resources/application.yaml b/tests/integration/config/gh-4375/src/test/resources/application.yaml
new file mode 100644
index 00000000000..edeed54ed5c
--- /dev/null
+++ b/tests/integration/config/gh-4375/src/test/resources/application.yaml
@@ -0,0 +1,17 @@
+#
+# 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.
+#
+
+yamlMpConfigExists: true
diff --git a/tests/integration/config/hocon-mp/pom.xml b/tests/integration/config/hocon-mp/pom.xml
index 57d31170041..43c19318efa 100644
--- a/tests/integration/config/hocon-mp/pom.xml
+++ b/tests/integration/config/hocon-mp/pom.xml
@@ -47,15 +47,5 @@
junit-jupiter-api
test
-
- org.hamcrest
- hamcrest-core
- test
-
-
- io.helidon.microprofile.tests
- helidon-microprofile-tests-junit5
- test
-
diff --git a/tests/integration/config/hocon-mp/src/test/java/io/helidon/config/hocon/mp/HoconJsonMpMetaConfigTest.java b/tests/integration/config/hocon-mp/src/test/java/io/helidon/config/hocon/mp/HoconJsonMpMetaConfigTest.java
index 1c133901c4f..25ca15ab982 100644
--- a/tests/integration/config/hocon-mp/src/test/java/io/helidon/config/hocon/mp/HoconJsonMpMetaConfigTest.java
+++ b/tests/integration/config/hocon-mp/src/test/java/io/helidon/config/hocon/mp/HoconJsonMpMetaConfigTest.java
@@ -34,7 +34,7 @@
*
* This will use SeContainerInitializer rather than @HelidonTest as the latter does not make meta-config work
*/
-public class HoconJsonMpMetaConfigTest {
+class HoconJsonMpMetaConfigTest {
private static ConfigBean bean;
private static SeContainer container;