Skip to content

Commit b17a99f

Browse files
authored
Merge pull request #50200 from radcortez/srconfig-3.14.0
Update Smallrye Config to 3.14.0
2 parents d1c7163 + d979646 commit b17a99f

File tree

17 files changed

+53
-52
lines changed

17 files changed

+53
-52
lines changed

bom/application/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<microprofile-lra.version>2.0.1</microprofile-lra.version>
4848
<microprofile-openapi.version>4.0.2</microprofile-openapi.version>
4949
<smallrye-common.version>2.13.9</smallrye-common.version>
50-
<smallrye-config.version>3.13.4</smallrye-config.version>
50+
<smallrye-config.version>3.14.0</smallrye-config.version>
5151
<smallrye-health.version>4.2.0</smallrye-health.version>
5252
<smallrye-metrics.version>4.0.0</smallrye-metrics.version>
5353
<smallrye-open-api.version>4.0.12</smallrye-open-api.version>

core/deployment/src/main/java/io/quarkus/deployment/configuration/BuildTimeConfigurationReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ public Set<String> getPropertyNames() {
387387
@Override
388388
public String getValue(final String propertyName) {
389389
// Required because some interceptors call getValue when iterating names
390-
return config.getRawValue(propertyName);
390+
return config.getConfigValue(propertyName).getValue();
391391
}
392392
};
393393

core/deployment/src/main/java/io/quarkus/deployment/configuration/ConfigMappingUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ private static void processConfigClass(
130130
.build());
131131
reflectiveMethods.produce(new ReflectiveMethodBuildItem(ConfigMappingUtils.class.getName(),
132132
mappingMetadata.getClassName(), "getProperties", new String[0]));
133+
reflectiveMethods.produce(new ReflectiveMethodBuildItem(ConfigMappingUtils.class.getName(),
134+
mappingMetadata.getClassName(), "getSecrets", new String[0]));
133135

134136
configComponentInterfaces.add(mappingMetadata.getInterfaceType());
135137

core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public Set<String> getPropertyNames() {
112112

113113
@Override
114114
public String getValue(final String propertyName) {
115-
return config.getRawValue(propertyName);
115+
return config.getConfigValue(propertyName).getValue();
116116
}
117117

118118
@Override

core/runtime/src/test/java/io/quarkus/runtime/configuration/ConfigProfileTestCase.java

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.quarkus.runtime.configuration;
22

33
import static io.quarkus.runtime.configuration.ConfigUtils.emptyConfigBuilder;
4-
import static java.util.stream.Collectors.toList;
54
import static org.junit.jupiter.api.Assertions.assertEquals;
65
import static org.junit.jupiter.api.Assertions.assertFalse;
76
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -84,7 +83,7 @@ void overriddenProfileHigherOrdinal() {
8483
.withSources(new PropertiesConfigSource(maps("%foo.foo", "profile"), "source", 100))
8584
.build();
8685

87-
assertEquals("default", config.getRawValue("foo"));
86+
assertEquals("default", config.getConfigValue("foo").getValue());
8887
} finally {
8988
System.clearProperty("quarkus.profile");
9089
}
@@ -96,7 +95,7 @@ void profileNoErrorOnExpansion() {
9695
try {
9796
final SmallRyeConfig config = configBuilder("foo", "${noExpansionAvailable}", "%foo.foo", "profile").build();
9897

99-
assertEquals("profile", config.getRawValue("foo"));
98+
assertEquals("profile", config.getConfigValue("foo").getValue());
10099
} finally {
101100
System.clearProperty("quarkus.profile");
102101
}
@@ -123,7 +122,7 @@ public void profileOnly() {
123122
try {
124123
final SmallRyeConfig config = buildConfig("my.prop", "1", "%prof.my.prop", "2");
125124

126-
assertEquals("2", config.getRawValue("my.prop"));
125+
assertEquals("2", config.getConfigValue("my.prop").getValue());
127126
} finally {
128127
System.clearProperty("quarkus.profile");
129128
}
@@ -135,7 +134,7 @@ public void fallback() {
135134
try {
136135
final SmallRyeConfig config = buildConfig("my.prop", "1");
137136

138-
assertEquals("1", config.getRawValue("my.prop"));
137+
assertEquals("1", config.getConfigValue("my.prop").getValue());
139138
} finally {
140139
System.clearProperty("quarkus.profile");
141140
}
@@ -148,7 +147,7 @@ public void expressions() {
148147
try {
149148
final SmallRyeConfig config = buildConfig("my.prop", "1", "%prof.my.prop", "${my.prop}");
150149

151-
assertThrows(IllegalArgumentException.class, () -> config.getRawValue("my.prop"));
150+
assertThrows(IllegalArgumentException.class, () -> config.getConfigValue("my.prop"));
152151
} finally {
153152
System.clearProperty("quarkus.profile");
154153
System.clearProperty("my.prop");
@@ -164,7 +163,7 @@ public void profileExpressions() {
164163
"%prof.my.prop", "${%prof.my.prop.profile}",
165164
"%prof.my.prop.profile", "2");
166165

167-
assertEquals("2", config.getRawValue("my.prop"));
166+
assertEquals("2", config.getConfigValue("my.prop").getValue());
168167
} finally {
169168
System.clearProperty("quarkus.profile");
170169
System.clearProperty("%prof.my.prop.profile");
@@ -196,7 +195,7 @@ public void noConfigProfile() {
196195
new ExpressionConfigSourceInterceptor())
197196
.build();
198197

199-
assertEquals("2", config.getRawValue("my.prop"));
198+
assertEquals("2", config.getConfigValue("my.prop").getValue());
200199
}
201200

202201
@Test
@@ -210,7 +209,7 @@ public void priorityProfile() {
210209
100))
211210
.build();
212211

213-
assertEquals("higher-profile", config.getRawValue("my.prop"));
212+
assertEquals("higher-profile", config.getConfigValue("my.prop").getValue());
214213
} finally {
215214
System.clearProperty("quarkus.profile");
216215
}
@@ -227,7 +226,7 @@ public void priorityOverrideProfile() {
227226
100))
228227
.build();
229228

230-
assertEquals("higher", config.getRawValue("my.prop"));
229+
assertEquals("higher", config.getConfigValue("my.prop").getValue());
231230
} finally {
232231
System.clearProperty("quarkus.profile");
233232
}
@@ -245,7 +244,7 @@ public void priorityProfileOverOriginal() {
245244
100))
246245
.build();
247246

248-
assertEquals("higher-profile", config.getRawValue("my.prop"));
247+
assertEquals("higher-profile", config.getConfigValue("my.prop").getValue());
249248
} finally {
250249
System.clearProperty("quarkus.profile");
251250
}
@@ -257,11 +256,10 @@ public void propertyNames() {
257256
try {
258257
final SmallRyeConfig config = buildConfig("my.prop", "1", "%prof.my.prop", "2", "%prof.prof.only", "1");
259258

260-
assertEquals("2", config.getRawValue("my.prop"));
261-
assertEquals("1", config.getRawValue("prof.only"));
259+
assertEquals("2", config.getConfigValue("my.prop").getValue());
260+
assertEquals("1", config.getConfigValue("prof.only").getValue());
262261

263-
final List<String> properties = StreamSupport.stream(config.getPropertyNames().spliterator(), false)
264-
.collect(toList());
262+
final List<String> properties = StreamSupport.stream(config.getPropertyNames().spliterator(), false).toList();
265263
assertFalse(properties.contains("%prof.my.prop")); // We are removing profile properties in SmallRyeConfig and keep only the main name.
266264
assertTrue(properties.contains("my.prop"));
267265
assertTrue(properties.contains("prof.only"));

devtools/cli/src/test/java/io/quarkus/cli/config/SetConfigTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void setUp() throws Exception {
3434
void addConfiguration() throws Exception {
3535
CliDriver.Result result = CliDriver.execute(tempDir, "config", "set", "foo.bar", "1234");
3636
assertEquals(0, result.getExitCode());
37-
assertEquals("1234", config().getRawValue("foo.bar"));
37+
assertEquals("1234", config().getConfigValue("foo.bar").getValue());
3838
}
3939

4040
@Test
@@ -50,7 +50,7 @@ void setConfiguration() throws Exception {
5050
}
5151
CliDriver.Result result = CliDriver.execute(tempDir, "config", "set", "foo.bar", "5678");
5252
assertEquals(0, result.getExitCode());
53-
assertEquals("5678", config().getRawValue("foo.bar"));
53+
assertEquals("5678", config().getConfigValue("foo.bar").getValue());
5454
}
5555

5656
@Test
@@ -61,7 +61,7 @@ void addEncryptedConfiguration() throws Exception {
6161
SmallRyeConfig config = config();
6262
assertEquals("1234", config.getConfigValue("foo.bar").getValue());
6363

64-
String encryption = config.getRawValue("smallrye.config.secret-handler.aes-gcm-nopadding.encryption-key");
64+
String encryption = config.getConfigValue("smallrye.config.secret-handler.aes-gcm-nopadding.encryption-key").getValue();
6565
assertNotNull(encryption);
6666

6767
result = CliDriver.execute(tempDir, "config", "set", "foo.baz", "5678", "-k");

devtools/gradle/gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
plugin-publish = "2.0.0"
33

44
kotlin = "2.2.20"
5-
smallrye-config = "3.13.4"
5+
smallrye-config = "3.14.0"
66

77
junit5 = "5.13.4"
88
assertj = "3.27.5"

extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/OpenTelemetryResourceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void resource() {
6363
final SpanData server = getSpanByKindAndParentId(spans, SERVER, "0000000000000000");
6464
assertEquals("GET /hello", server.getName());
6565
assertEquals("authservice", server.getResource().getAttribute(AttributeKey.stringKey("service.name")));
66-
assertEquals(config.getRawValue("quarkus.uuid"),
66+
assertEquals(config.getConfigValue("quarkus.uuid").getValue(),
6767
server.getResource().getAttribute(AttributeKey.stringKey("service.instance.id")));
6868
assertNotNull(server.getResource().getAttribute(AttributeKey.stringKey("host.name")));
6969

extensions/opentelemetry/deployment/src/test/java/io/quarkus/opentelemetry/deployment/interceptor/WithSpanInterceptorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public static class SpanRestClient {
302302
public void spanRestClient() {
303303
try (Client client = ClientBuilder.newClient()) {
304304
WebTarget target = client.target(UriBuilder
305-
.fromUri(config.getRawValue("test.url"))
305+
.fromUri(config.getConfigValue("test.url").getValue())
306306
.path("hello"));
307307
Response response = target.request().get();
308308
assertEquals(HTTP_OK, response.getStatus());

extensions/resteasy-classic/resteasy-client/deployment/src/test/java/io/quarkus/restclient/configuration/RestClientOverrideRuntimeConfigTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void buildTime() {
7878
Set<String> properties = StreamSupport.stream(config.getPropertyNames().spliterator(), false).collect(toSet());
7979
// MP/mp-rest/url - This one exists at build time
8080
assertTrue(properties.contains("BT-MP/mp-rest/url"));
81-
assertEquals("from-mp", config.getRawValue("BT-MP/mp-rest/url"));
81+
assertEquals("from-mp", config.getConfigValue("BT-MP/mp-rest/url").getValue());
8282
// quarkus.rest-client.MP.url - Is not set, and it is not recorded
8383
assertFalse(properties.contains("quarkus.rest-client.BT-MP.url"));
8484

0 commit comments

Comments
 (0)