This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit daf9d25cd29f1302333e1fe5b7f73f21fb26dd6d Author: lburgazzoli <lburgazz...@gmail.com> AuthorDate: Sun Aug 11 23:24:20 2019 +0200 CAMEL-13854: camel-microprofile-config: service file point to the wrong class --- .../services/org/apache/camel/properties-source-factory | 2 +- .../config/CamelMicroProfilePropertiesSourceTest.java | 11 +++-------- .../camel/component/properties/PropertiesComponent.java | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/components/camel-microprofile-config/src/main/resources/META-INF/services/org/apache/camel/properties-source-factory b/components/camel-microprofile-config/src/main/resources/META-INF/services/org/apache/camel/properties-source-factory index 74bd136..0e0b1a7 100644 --- a/components/camel-microprofile-config/src/main/resources/META-INF/services/org/apache/camel/properties-source-factory +++ b/components/camel-microprofile-config/src/main/resources/META-INF/services/org/apache/camel/properties-source-factory @@ -15,4 +15,4 @@ # limitations under the License. # -class=org.apache.camel.component.microprofile.config.CamelMicroProfileConfigSource +class=org.apache.camel.component.microprofile.config.CamelMicroProfilePropertiesSource diff --git a/components/camel-microprofile-config/src/test/java/org/apache/camel/component/microprofile/config/CamelMicroProfilePropertiesSourceTest.java b/components/camel-microprofile-config/src/test/java/org/apache/camel/component/microprofile/config/CamelMicroProfilePropertiesSourceTest.java index 8ede269..1487926 100644 --- a/components/camel-microprofile-config/src/test/java/org/apache/camel/component/microprofile/config/CamelMicroProfilePropertiesSourceTest.java +++ b/components/camel-microprofile-config/src/test/java/org/apache/camel/component/microprofile/config/CamelMicroProfilePropertiesSourceTest.java @@ -23,7 +23,6 @@ import io.smallrye.config.SmallRyeConfigBuilder; import org.apache.camel.CamelContext; import org.apache.camel.RoutesBuilder; import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.properties.PropertiesComponent; import org.apache.camel.test.junit4.CamelTestSupport; import org.eclipse.microprofile.config.Config; import org.eclipse.microprofile.config.spi.ConfigProviderResolver; @@ -40,16 +39,12 @@ public class CamelMicroProfilePropertiesSourceTest extends CamelTestSupport { prop.put("my-mock", "result"); // create PMC config source and register it so we can use it for testing - PropertiesConfigSource pcs = new PropertiesConfigSource(prop, "my-smallrye-config"); + final PropertiesConfigSource pcs = new PropertiesConfigSource(prop, "my-smallrye-config"); final Config config = new SmallRyeConfigBuilder().withSources(pcs).build(); + ConfigProviderResolver.instance().registerConfig(config, CamelMicroProfilePropertiesSourceTest.class.getClassLoader()); - // should auto-detect this JAR on the classpath and use it (but this can only be tested outside this component) - CamelContext context = super.createCamelContext(); - // ... so we add the source manually - PropertiesComponent pc = (PropertiesComponent) context.getPropertiesComponent(); - pc.addPropertiesSource(new CamelMicroProfilePropertiesSource()); - return context; + return super.createCamelContext(); } @Test diff --git a/components/camel-properties/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java b/components/camel-properties/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java index a97f446..17db6ba 100644 --- a/components/camel-properties/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java +++ b/components/camel-properties/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java @@ -461,7 +461,7 @@ public class PropertiesComponent extends DefaultComponent implements org.apache. // discover any 3rd party properties sources try { - FactoryFinder factoryFinder = getCamelContext().adapt(ExtendedCamelContext.class).getFactoryFinder("META-INF/services/org/apache/camel"); + FactoryFinder factoryFinder = getCamelContext().adapt(ExtendedCamelContext.class).getFactoryFinder("META-INF/services/org/apache/camel/"); Class<?> type = factoryFinder.findClass("properties-source-factory").orElse(null); if (type != null) { Object obj = getCamelContext().getInjector().newInstance(type, false);