Skip to content

Commit

Permalink
Merge pull request #37931 from weltonrodrigo/patch-2
Browse files Browse the repository at this point in the history
Document that `QuarkuTestResourceLifecycleManager` is not a CDI Bean
  • Loading branch information
geoand authored Jan 3, 2024
2 parents 30c3267 + 4a9b212 commit 394af15
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/src/main/asciidoc/getting-started-testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 something into the test class, the `inject` methods can be used.
Expand Down

0 comments on commit 394af15

Please sign in to comment.