From 4a9b2126fe3c332dcd4489ff42a65adf2b55d484 Mon Sep 17 00:00:00 2001 From: Welton Rodrigo Torres Nascimento Date: Mon, 25 Dec 2023 15:32:28 -0300 Subject: [PATCH] Update getting-started-testing.adoc Add information abot how to load configuration values inside a `QuarkusTestResourceLifecycleManager` --- docs/src/main/asciidoc/getting-started-testing.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/src/main/asciidoc/getting-started-testing.adoc b/docs/src/main/asciidoc/getting-started-testing.adoc index 31639cfb3af85..b3729cea4cf90 100644 --- a/docs/src/main/asciidoc/getting-started-testing.adoc +++ b/docs/src/main/asciidoc/getting-started-testing.adoc @@ -1086,6 +1086,8 @@ but it is common to create custom implementations to address specific applicatio Common cases include starting docker containers using https://www.testcontainers.org/[Testcontainers] (an example of which can be found https://github.com/quarkusio/quarkus/blob/main/test-framework/keycloak-server/src/main/java/io/quarkus/test/keycloak/server/KeycloakTestResourceLifecycleManager.java[here]), or starting a mock HTTP server using https://wiremock.org/[Wiremock] (an example of which can be found https://github.com/geoand/quarkus-test-demo/blob/main/src/test/java/org/acme/getting/started/country/WiremockCountries.java[here]). +NOTE: As `QuarkusTestResourceLifecycleManager` is not a CDI Bean, classes that implement it can't have fields injected with `@Inject`. You can use `String propertyName = ConfigProvider.getConfig().getValue("quarkus.my-config-group.myconfig", String.class);` + === Altering the test class When creating a custom `QuarkusTestResourceLifecycleManager` that needs to inject the something into the test class, the `inject` methods can be used.