From ee0dbf90c1ba76050d8d38def56c850086a6cd35 Mon Sep 17 00:00:00 2001 From: Markus Jung Date: Mon, 11 Nov 2024 16:47:37 +0100 Subject: [PATCH] fix #1246: honor ConfigProperties.UNCONFIGURED_PREFIX again (#1248) --- .../java/io/smallrye/config/inject/ConfigExtension.java | 9 +++++++-- testsuite/tck/pom.xml | 2 -- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cdi/src/main/java/io/smallrye/config/inject/ConfigExtension.java b/cdi/src/main/java/io/smallrye/config/inject/ConfigExtension.java index 5bbd60451..1f110375f 100644 --- a/cdi/src/main/java/io/smallrye/config/inject/ConfigExtension.java +++ b/cdi/src/main/java/io/smallrye/config/inject/ConfigExtension.java @@ -99,10 +99,15 @@ protected void processConfigProperties( // We are going to veto, because it may be a managed bean, and we will use a configurator bean processAnnotatedType.veto(); + // Unconfigured is represented as an empty String in SmallRye Config + String prefix = annotatedType.getAnnotation(ConfigProperties.class).prefix(); + if (ConfigProperties.UNCONFIGURED_PREFIX.equals(prefix)) { + prefix = ""; + } + // Each config class is both in SmallRyeConfig and managed by a configurator bean. // CDI requires more beans for injection points due to binding prefix. - ConfigClass properties = ConfigClass.configClass(annotatedType.getJavaClass(), - annotatedType.getAnnotation(ConfigProperties.class).prefix()); + ConfigClass properties = ConfigClass.configClass(annotatedType.getJavaClass(), prefix); configProperties.add(properties); configPropertiesBeans.add(properties); } diff --git a/testsuite/tck/pom.xml b/testsuite/tck/pom.xml index abc6511bf..71d86a2a8 100644 --- a/testsuite/tck/pom.xml +++ b/testsuite/tck/pom.xml @@ -57,8 +57,6 @@ org.eclipse.microprofile.config.tck.ConverterTest - org.eclipse.microprofile.config.tck.ConfigPropertiesTest - org.eclipse.microprofile.config.tck.broken.ConfigPropertiesMissingPropertyInjectionTest