Skip to content

Commit dbab476

Browse files
committed
Allow single @afterall when AutoCleanupExtension not otherwise needed
1 parent 2d29901 commit dbab476

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/agents/knowledge/testing-general-patterns.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
over wrapping most of the test body in try-with-resources.
2020
- For resources created in `@BeforeAll` or other class-scoped setup, prefer
2121
`AutoCleanupExtension` with `deferAfterAll(...)` over nested `@AfterAll` cleanup
22-
chains.
22+
chains. A single solitary `@AfterAll` is acceptable when `AutoCleanupExtension` is not
23+
otherwise present or needed in the class.
2324
- Reuse an existing `cleanup` extension when one is already in scope.
2425
Otherwise, add a `@RegisterExtension` field when the deferred-cleanup pattern improves
2526
clarity or avoids wrapping most of the test body.

0 commit comments

Comments
 (0)