Skip to content

Commit 143beb4

Browse files
Document cases where @EnabledIf/@DisabledIf require static condition methods
Resolves #3068
1 parent 535cf61 commit 143beb4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

documentation/src/docs/asciidoc/user-guide/writing-tests.adoc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,10 +538,18 @@ package example;
538538
include::{testDir}/example/ExternalCustomConditionDemo.java[tags=user_guide_external_custom_condition]
539539
----
540540

541-
NOTE: When `@EnabledIf` or `@DisabledIf` is used at class level, the condition method must
542-
always be `static`. Condition methods located in external classes must also be `static`.
541+
[NOTE]
542+
====
543+
There are several cases where a condition method would need to be `static`:
544+
545+
- when `@EnabledIf` or `@DisabledIf` is used at class level
546+
- when `@EnabledIf` or `@DisabledIf` is used on a `@ParameterizedTest` or a
547+
`@TestTemplate` method
548+
- when the condition method is located in an external class
549+
543550
In any other case, you can use either static methods or instance methods as condition
544551
methods.
552+
====
545553

546554
[TIP]
547555
====

0 commit comments

Comments
 (0)