We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58a77f9 commit 71a28a3Copy full SHA for 71a28a3
1 file changed
.github/agents/knowledge/testing-general-patterns.md
@@ -18,6 +18,10 @@
18
Do not declare multiple checked exception types on a test method.
19
- Be as specific as possible. Prefer the narrowest single checked type that the test body
20
actually exposes instead of broad forms such as `throws Exception` or a multi-exception list.
21
+- Apply this guidance only to JUnit test entry points such as `@Test`,
22
+ `@ParameterizedTest`, `@RepeatedTest`, `@TestFactory`, and `@TestTemplate`.
23
+ Do **not** rewrite nearby helpers or utilities solely to narrow a test method's `throws`
24
+ clause, and do not apply this rule to every method in a testing module or abstract test base.
25
- If the test only blocks on `Future.get(...)` / `CompletableFuture.get(...)`, prefer refactoring to
26
`join()` or another non-checked wait path when that keeps the test clear, rather than widening the
27
test method to `throws Exception` just to avoid a multi-exception `throws` clause.
0 commit comments