You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QuarkusComponentTest: skip system config sources by default
This is a breaking change but I believe that it makes sense and the main
goal is to mitigate the problem with Quarkus test profiles described in
#48899.
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/testing-components.adoc
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -297,6 +297,12 @@ NOTE: `@io.quarkus.test.component.TestConfigProperty` declared on a `@Nested` te
297
297
298
298
CDI beans are also automatically registered for all injected https://smallrye.io/smallrye-config/Main/config/mappings/[Config Mappings]. The mappings are populated with the test configuration properties.
299
299
300
+
=== Config sources
301
+
302
+
By default, only the config properties from `application.properties` and properties set by the `@TestConfigProperty` annotation or with the `QuarkusComponentTestExtensionBuilder#configProperty(String, String)` method are included in the test config.
303
+
System properties and ENV variables are _not_ included in the test config by default.
304
+
However, you can use `@QuarkusComponentTest#useSystemConfigSources()` or `QuarkusComponentTestExtensionBuilder#useSystemConfigSources()` to configure this behavior.
305
+
300
306
== Mocking CDI Interceptors
301
307
302
308
If a tested component class declares an interceptor binding then you might need to mock the interception too.
Copy file name to clipboardExpand all lines: test-framework/junit5-component/src/main/java/io/quarkus/test/component/QuarkusComponentTestConfiguration.java
+9-4Lines changed: 9 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -63,14 +63,15 @@ class QuarkusComponentTestConfiguration {
Copy file name to clipboardExpand all lines: test-framework/junit5-component/src/main/java/io/quarkus/test/component/QuarkusComponentTestExtension.java
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -212,7 +212,7 @@ public QuarkusComponentTestExtension() {
Copy file name to clipboardExpand all lines: test-framework/junit5-component/src/main/java/io/quarkus/test/component/QuarkusComponentTestExtensionBuilder.java
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,7 @@ public class QuarkusComponentTestExtensionBuilder {
Copy file name to clipboardExpand all lines: test-framework/junit5-component/src/test/java/io/quarkus/test/component/config/ConfigSourceOrdinalTest.java
0 commit comments