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
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/getting-started-testing.adoc
+9-19Lines changed: 9 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1241,25 +1241,15 @@ public @interface WithRepeatableTestResource {
1241
1241
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.
1242
1242
`@WithTestResources` has a `scope` property that takes a `TestResourceScope` enum value:
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:
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
0 commit comments