Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions test-framework/junit-component/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
<artifactId>smallrye-common-annotation</artifactId>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>io.smallrye.config</groupId>
<artifactId>smallrye-config-source-yaml</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.logmanager</groupId>
<artifactId>jboss-logmanager</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ private void startContainer(ExtensionContext context, Lifecycle testInstanceLife
// We intentionally skip system properties and ENV variables by default
// See https://github.com/quarkusio/quarkus/issues/48899 for more details
.addPropertiesSources()
.addDiscoveredSources()
.withSources(
new QuarkusComponentTestConfigSource(configProperties,
configuration.configSourceOrdinal));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package io.quarkus.test.component;

import static org.junit.jupiter.api.Assertions.assertEquals;

import jakarta.inject.Inject;
import jakarta.inject.Singleton;

import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

public class ApplicationYamlConfigSourceTest {

@RegisterExtension
static final QuarkusComponentTestExtension extension = QuarkusComponentTestExtension.builder()
.build();

@Inject
YamlComponent component;

@Test
public void testYamlConfig() {
assertEquals("from-yaml", component.yamlProperty);
}

@Singleton
public static class YamlComponent {

@ConfigProperty(name = "org.acme.yaml-property")
String yamlProperty;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
org:
acme:
yaml-property: from-yaml