Skip to content

Commit 2612663

Browse files
geoandgsmet
authored andcommitted
Address leftovers in testing docs from #44685
(cherry picked from commit 107e4ea)
1 parent 8d6844e commit 2612663

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

docs/src/main/asciidoc/getting-started-testing.adoc

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,25 +1241,15 @@ public @interface WithRepeatableTestResource {
12411241
While test resources provided by `@QuarkusTestResource` are available either globally or restricted to the annotated test class (`restrictToAnnotatedClass`), the annotation `@WithTestResources` allows to additionally group tests by test resources for execution.
12421242
`@WithTestResources` has a `scope` property that takes a `TestResourceScope` enum value:
12431243

1244-
- `TestResourceScope.MATCHING_RESOURCES` (default) +
1245-
Quarkus will group tests with the same test resources and run them together. After a group has been executed, all test resources will be stopped, and the next group will be executed.
1246-
- `TestResourceScope.RESTRICTED_TO_CLASS` +
1247-
The test resource is available only for the annotated test class and will be stopped after the test class has been executed. This is equivalent to using @QuarkusTestResource with restrictToAnnotatedClass = true.
1248-
- `TestResourceScope.GLOBAL` +
1249-
The test resource is available globally.
1250-
This is equivalent to using `@QuarkusTestResource` with `restrictToAnnotatedClass = false`.
1251-
1252-
NOTE: `@QuarkusTestResource` is merely a convenient extension of `@WithTestResources` for the use of global test resources
1253-
1254-
BELOW TO EDIT: +
1255-
I don't know the behaviour when different scopes are mixed 🤷‍♂️Example:
1256-
```java
1257-
@WithTestResources(value = TestResourceA.class, scope = TestResourceScope.MATCHING_RESOURCES)
1258-
@WithTestResources(value = TestResourceB.class, scope = TestResourceScope.RESTRICTED_TO_CLASS)
1259-
@WithTestResources(value = TestResourceC.class, scope = TestResourceScope.GLOBAL)
1260-
class TestClass(){}
1261-
```
1262-
Also maybe add a use case example for why this annotation got introduced and what for the different scopes are useful, as we currently only use GLOBAL because of time reason.
1244+
- `TestResourceScope.MATCHING_RESOURCES` (default): Quarkus will group tests with the same test resources and run them together. After a group has been executed, all test resources will be stopped, and the next group will be executed.
1245+
- `TestResourceScope.RESTRICTED_TO_CLASS`: The test resource is available only for the annotated test class and will be stopped after the test class has been executed.
1246+
- `TestResourceScope.GLOBAL`: Test resources apply to all tests in the testsuite
1247+
1248+
Quarkus needs to restart if one of the following is true:
1249+
1250+
- At least one the existing test resources is restricted to the test class
1251+
- At least one the next test resources is restricted to the test class
1252+
- Different {@code MATCHING_RESOURCE} scoped test resources are being used
12631253

12641254
== Hang Detection
12651255

0 commit comments

Comments
 (0)